473,612 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

setting a breakpoint in a WinForms event handler... and then getting caught in the event loop.

What is the triggering action that raises the event which causes my
breakpoint to be reached, repeatedly, but does not allow my form to ever
remain visible. I set a breakpoint on the line Graphics.. below. Just
curious to help my 'system level' understanding. thx. -hazz

private void InitializeCompo nent() {
this.Paint += new
System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }

static void Main() {
Application.Run (new Wassup_widdis() ); }

private void Wassup_widdis_P aint(object sender,
System.Windows. Forms.PaintEven tArgs e) {
->Graphics grfx = e.Graphics; }
Nov 16 '05 #1
8 2020
Since the code execution is paused in the paint event there is no way for
the form to paint. Chances are the break point being hit causes your form to
be covered. you can try resizing VS.net and your form so both can be seen
entirely on the screen all at once.

This is the main reason I have two monitors on my work station. The form
goes on one and VS.net on the other when debugging paint routines.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute. But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Hazz" <ha**@nospamero osonic.net> wrote in message
news:eV******** ******@TK2MSFTN GP12.phx.gbl...
What is the triggering action that raises the event which causes my
breakpoint to be reached, repeatedly, but does not allow my form to ever
remain visible. I set a breakpoint on the line Graphics.. below. Just
curious to help my 'system level' understanding. thx. -hazz

private void InitializeCompo nent() {
this.Paint += new
System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }

static void Main() {
Application.Run (new Wassup_widdis() ); }

private void Wassup_widdis_P aint(object sender,
System.Windows. Forms.PaintEven tArgs e) {
->Graphics grfx = e.Graphics; }

Nov 16 '05 #2
Hazz,

The Paint event is triggered each time your form is redrawn. If you set
a breakpoint there, control will be given to your debugger. This will
keep your form from ever being redrawn properly.

Regards,
Joakim

Hazz wrote:
What is the triggering action that raises the event which causes my
breakpoint to be reached, repeatedly, but does not allow my form to ever
remain visible. I set a breakpoint on the line Graphics.. below. Just
curious to help my 'system level' understanding. thx. -hazz

private void InitializeCompo nent() {
this.Paint += new
System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }

static void Main() {
Application.Run (new Wassup_widdis() ); }

private void Wassup_widdis_P aint(object sender,
System.Windows. Forms.PaintEven tArgs e) {
->Graphics grfx = e.Graphics; }

Nov 16 '05 #3
Thank you for the explanation and the very good tip Wayne. Is there any
special sotware configuration/setting in order to use the two monitors this
way?
Thank you again. -hazz

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OF******** ******@TK2MSFTN GP14.phx.gbl...
Since the code execution is paused in the paint event there is no way for
the form to paint. Chances are the break point being hit causes your form
to
be covered. you can try resizing VS.net and your form so both can be seen
entirely on the screen all at once.

This is the main reason I have two monitors on my work station. The form
goes on one and VS.net on the other when debugging paint routines.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute.
But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Hazz" <ha**@nospamero osonic.net> wrote in message
news:eV******** ******@TK2MSFTN GP12.phx.gbl...
What is the triggering action that raises the event which causes my
breakpoint to be reached, repeatedly, but does not allow my form to ever
remain visible. I set a breakpoint on the line Graphics.. below. Just
curious to help my 'system level' understanding. thx. -hazz

private void InitializeCompo nent() {
this.Paint += new
System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }

static void Main() {
Application.Run (new Wassup_widdis() ); }

private void Wassup_widdis_P aint(object sender,
System.Windows. Forms.PaintEven tArgs e) {
->Graphics grfx = e.Graphics; }


Nov 16 '05 #4
Thank you Joakim. I think I understand that. Events being what they are,
the debugger and display will have to simply play tricks on the developer.
The CPU and the VS tools can only do so much. The two monitor solution
mentioned by Wayne sounds like a real good idea.

"Joakim Karlsson" <jk*******@NOSP AMjkarlsson.com > wrote in message
news:OQ******** *****@TK2MSFTNG P09.phx.gbl...
Hazz,

The Paint event is triggered each time your form is redrawn. If you set a
breakpoint there, control will be given to your debugger. This will keep
your form from ever being redrawn properly.

Regards,
Joakim

Hazz wrote:
What is the triggering action that raises the event which causes my
breakpoint to be reached, repeatedly, but does not allow my form to ever
remain visible. I set a breakpoint on the line Graphics.. below. Just
curious to help my 'system level' understanding. thx. -hazz

private void InitializeCompo nent() {
this.Paint += new
System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }

static void Main() {
Application.Run (new Wassup_widdis() ); }

private void Wassup_widdis_P aint(object sender,
System.Windows. Forms.PaintEven tArgs e) {
->Graphics grfx = e.Graphics; }

Nov 16 '05 #5
clu
There's special software you should for a multiple monitor
configuration.

The video drivers will let you move windows from one monitor to the
other (if that's the configuration you choose), which is what you need
for having both the debugger and the app windows visible and maximized.

Regards

Claudio Brotto

Nov 16 '05 #6
Really no special software you need, just video cards with drivers that
support multiple monitors. I've been doing multi monitor since 98. Recently
it's gotten much easier to do, as most high end video cards are not dual
head cards. Configuration with them is much more reliable (that you'll get
it working) than having two cards.

With that said you can go with one of the following:

1) 1 agp dual head card
2) 1 Agp card and 1 pci card
3) 2 pci cards

I've had the best luck when doing dual cards using ATI's cards. If you go
the multi card route I would suggest searching on multiple monitors, there
are a few sites out there that allow people to share their experience of
what cards they used an how hard/easy they were to get configured. I
actually screwed up my 98 machine so bad once I had to reinstall, but then
again it was 98.

I would highly suggest getting a dual head card if you are going to do it. I
currently have two Matrox G450's and a ATI 9800Pro all three are dual head
and have served me very well. NVida makes dual head cards as well, though
I've never used one as of yet.

http://search.ebay.com/g450_W0QQfkrZ1QQfromZR8 <-- searched on G450, appears
they go for around $10. Third link in the result, at least for the next
8hrs, is a Quad version of the card. G450 is great for a development
machine, but wouldn't do well with today's games.
"Hazz" <ha**@nospamero osonic.net> wrote in message
news:OW******** ******@TK2MSFTN GP14.phx.gbl...
Thank you for the explanation and the very good tip Wayne. Is there any
special sotware configuration/setting in order to use the two monitors this way?
Thank you again. -hazz

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OF******** ******@TK2MSFTN GP14.phx.gbl...
Since the code execution is paused in the paint event there is no way for the form to paint. Chances are the break point being hit causes your form to
be covered. you can try resizing VS.net and your form so both can be seen entirely on the screen all at once.

This is the main reason I have two monitors on my work station. The form
goes on one and VS.net on the other when debugging paint routines.

--
Thanks
Wayne Sepega
Jacksonville, Fl
"When a man sits with a pretty girl for an hour, it seems like a minute.
But
let him sit on a hot stove for a minute and it's longer than any hour.
That's relativity." - Albert Einstein

"Hazz" <ha**@nospamero osonic.net> wrote in message
news:eV******** ******@TK2MSFTN GP12.phx.gbl...
What is the triggering action that raises the event which causes my
breakpoint to be reached, repeatedly, but does not allow my form to ever remain visible. I set a breakpoint on the line Graphics.. below. Just
curious to help my 'system level' understanding. thx. -hazz

private void InitializeCompo nent() {
this.Paint += new
System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }

static void Main() {
Application.Run (new Wassup_widdis() ); }

private void Wassup_widdis_P aint(object sender,
System.Windows. Forms.PaintEven tArgs e) {
->Graphics grfx = e.Graphics; }



Nov 16 '05 #7
Thank you Wayne. In addition to the video card/driver considertions, are
there any Visual Studio settings at play here?
Thank you.
-hazz

"Wayne" <Me******@commu nity.nospam> wrote in message
news:uw******** *****@TK2MSFTNG P09.phx.gbl...
Really no special software you need, just video cards with drivers that
support multiple monitors. I've been doing multi monitor since 98.
Recently
it's gotten much easier to do, as most high end video cards are not dual
head cards. Configuration with them is much more reliable (that you'll get
it working) than having two cards.

With that said you can go with one of the following:

1) 1 agp dual head card
2) 1 Agp card and 1 pci card
3) 2 pci cards

I've had the best luck when doing dual cards using ATI's cards. If you go
the multi card route I would suggest searching on multiple monitors, there
are a few sites out there that allow people to share their experience of
what cards they used an how hard/easy they were to get configured. I
actually screwed up my 98 machine so bad once I had to reinstall, but then
again it was 98.

I would highly suggest getting a dual head card if you are going to do it.
I
currently have two Matrox G450's and a ATI 9800Pro all three are dual head
and have served me very well. NVida makes dual head cards as well, though
I've never used one as of yet.

http://search.ebay.com/g450_W0QQfkrZ1QQfromZR8 <-- searched on G450,
appears
they go for around $10. Third link in the result, at least for the next
8hrs, is a Quad version of the card. G450 is great for a development
machine, but wouldn't do well with today's games.
"Hazz" <ha**@nospamero osonic.net> wrote in message
news:OW******** ******@TK2MSFTN GP14.phx.gbl...
Thank you for the explanation and the very good tip Wayne. Is there any
special sotware configuration/setting in order to use the two monitors

this
way?
Thank you again. -hazz

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OF******** ******@TK2MSFTN GP14.phx.gbl...
> Since the code execution is paused in the paint event there is no way for > the form to paint. Chances are the break point being hit causes your form > to
> be covered. you can try resizing VS.net and your form so both can be seen > entirely on the screen all at once.
>
> This is the main reason I have two monitors on my work station. The
> form
> goes on one and VS.net on the other when debugging paint routines.
>
> --
> Thanks
> Wayne Sepega
> Jacksonville, Fl
>
>
> "When a man sits with a pretty girl for an hour, it seems like a
> minute.
> But
> let him sit on a hot stove for a minute and it's longer than any hour.
> That's relativity." - Albert Einstein
>
> "Hazz" <ha**@nospamero osonic.net> wrote in message
> news:eV******** ******@TK2MSFTN GP12.phx.gbl...
>> What is the triggering action that raises the event which causes my
>> breakpoint to be reached, repeatedly, but does not allow my form to ever >> remain visible. I set a breakpoint on the line Graphics.. below. Just
>> curious to help my 'system level' understanding. thx. -hazz
>>
>> private void InitializeCompo nent() {
>> this.Paint += new
>> System.Windows. Forms.PaintEven tHandler(this.W assup_widdis_Pa int); }
>>
>> static void Main() {
>> Application.Run (new Wassup_widdis() ); }
>>
>> private void Wassup_widdis_P aint(object sender,
>> System.Windows. Forms.PaintEven tArgs e) {
>> ->Graphics grfx = e.Graphics; }
>>
>>
>
>



Nov 16 '05 #8
Nothing really that I've run into. You can take any window from one monitor
to another, so I tend to keep VS.net maximized on the primary monitor and my
running application when needed on the secondary monitor.

Wayne
"Hazz" <ha**@nospamero osonic.net> wrote in message
news:O3******** ******@TK2MSFTN GP09.phx.gbl...
Thank you Wayne. In addition to the video card/driver considertions, are
there any Visual Studio settings at play here?
Thank you.
-hazz

"Wayne" <Me******@commu nity.nospam> wrote in message
news:uw******** *****@TK2MSFTNG P09.phx.gbl...
Really no special software you need, just video cards with drivers that
support multiple monitors. I've been doing multi monitor since 98.
Recently
it's gotten much easier to do, as most high end video cards are not dual
head cards. Configuration with them is much more reliable (that you'll get it working) than having two cards.

With that said you can go with one of the following:

1) 1 agp dual head card
2) 1 Agp card and 1 pci card
3) 2 pci cards

I've had the best luck when doing dual cards using ATI's cards. If you go the multi card route I would suggest searching on multiple monitors, there are a few sites out there that allow people to share their experience of
what cards they used an how hard/easy they were to get configured. I
actually screwed up my 98 machine so bad once I had to reinstall, but then again it was 98.

I would highly suggest getting a dual head card if you are going to do it. I
currently have two Matrox G450's and a ATI 9800Pro all three are dual head and have served me very well. NVida makes dual head cards as well, though I've never used one as of yet.

http://search.ebay.com/g450_W0QQfkrZ1QQfromZR8 <-- searched on G450,
appears
they go for around $10. Third link in the result, at least for the next
8hrs, is a Quad version of the card. G450 is great for a development
machine, but wouldn't do well with today's games.
"Hazz" <ha**@nospamero osonic.net> wrote in message
news:OW******** ******@TK2MSFTN GP14.phx.gbl...
Thank you for the explanation and the very good tip Wayne. Is there any
special sotware configuration/setting in order to use the two monitors

this
way?
Thank you again. -hazz

"Wayne" <Me******@commu nity.nospam> wrote in message
news:OF******** ******@TK2MSFTN GP14.phx.gbl...
> Since the code execution is paused in the paint event there is no way

for
> the form to paint. Chances are the break point being hit causes your

form
> to
> be covered. you can try resizing VS.net and your form so both can be

seen
> entirely on the screen all at once.
>
> This is the main reason I have two monitors on my work station. The
> form
> goes on one and VS.net on the other when debugging paint routines.
>
> --
> Thanks
> Wayne Sepega
> Jacksonville, Fl
>
>
> "When a man sits with a pretty girl for an hour, it seems like a
> minute.
> But
> let him sit on a hot stove for a minute and it's longer than any hour. > That's relativity." - Albert Einstein
>
> "Hazz" <ha**@nospamero osonic.net> wrote in message
> news:eV******** ******@TK2MSFTN GP12.phx.gbl...
>> What is the triggering action that raises the event which causes my
>> breakpoint to be reached, repeatedly, but does not allow my form to

ever
>> remain visible. I set a breakpoint on the line Graphics.. below. Just >> curious to help my 'system level' understanding. thx. -hazz
>>
>> private void InitializeCompo nent() {
>> this.Paint += new
>> stem.Windows.Fo rms.PaintEventH andler(this.Was sup_widdis_Pain t); } >>
>> static void Main() {
>> Application.Run (new Wassup_widdis() ); }
>>
>> private void Wassup_widdis_P aint(object sender,
>> System.Windows. Forms.PaintEven tArgs e) {
>> ->Graphics grfx = e.Graphics; }
>>
>>
>
>



Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
9873
by: | last post by:
Hi, I am setting the NumericUpDown .Value property and the ValueChanged event is NOT being fired. Does this ONLY get fired when I change it on the UI and not programatically? Thanks
3
15949
by: deko | last post by:
I have a logging routine that's supposed to silently log errors caught by error handler code on certain functions. The problem is sometimes stuff happens and the error handler can get caught in a loop. Is there some way to send a break from VBA code to break out of the loop? Here's what the error handler code looks like: Private Function MyFunction On Error GoTo HandleErr
6
1679
by: Angel | last post by:
I have a button, combo, and custom control that i created. When I click the button i want to set certain display properties of my custom control depending whats in the combo. I set those properties in the Click_Event in the button control. Unfortunately postback is triggered in the click event before I set the display properties of the control. Is there anyway that I can set these properties before the postback is triggered? I'd like to do this...
0
1598
by: Mark | last post by:
There appear to be several ways to get the global error handler in global.asax.cs to fire repeatedly in a nasty endless loop. Is there a way to keep this event from firing only a handful of times over the course of a minute, so that if it's obviously caught in a vicious loop, it will stop? In our global error handler, we send an email warning developer's of the problem. However, if the global error handler fires repeatedly, we get...
12
4915
by: Mark Rae | last post by:
Hi, It's easy enough for a child page to manipulate its MasterPage's header simply by modifying the MasterPage thus: <header runat="server"> .... .... </header>
1
6472
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located at /usr/local/lib/php/php.ini. Any ideas why the setting does not seem to be having an effect? ...
12
7493
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use it to reset info in a combo box. Below is some sample code for my view interface and the presenter: public interface IDevToolView
4
5980
by: parez | last post by:
Hi, Whats the winforms equivalent of asp.net page load event? I am trying to clear a status message field every time a user clicks on any of the buttons..
23
4511
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I memorize and/ or familiarize myself in WinForms will disappear in WPF? I did note in one early version of C#, the non-generic "ArrayList" was replaced by the generic and template <based List, but that kind of change is not a big deal. If WPF...
0
8605
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8246
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5532
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4045
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4109
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1413
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.