943,545 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 8597
  • C# RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jan 27th, 2009
0

Re: redrawing panel

Well this are the results:

The sizechanged event wasn't good because it was only working when i manually changed the form size.In other cases it didn't fired.

The Form_paint event was a cure for my problem.It he fired when i minimized or maximized the form and also when i opened some other window on top of my form so this was the solution of my problem

Thanks for your help!!!!
Reputation Points: 10
Solved Threads: 0
Light Poster
nikola.rosic is offline Offline
27 posts
since Jul 2008
Jan 27th, 2009
0

Re: redrawing panel

Well one more thing.This is just from curiosity.As i have seen the formPaint_event is firing on almost anything.I have tried to find an explanation on the msdn and it says the event is firing every time the control is redrawn.But when is it redrawn.

I thought that this event is firing only the first time the control is created but it looks it isn't so!!!!
Reputation Points: 10
Solved Threads: 0
Light Poster
nikola.rosic is offline Offline
27 posts
since Jul 2008
Jan 27th, 2009
0

Re: redrawing panel

The form is redrawn when any portion of the form object is required to be drawn. This could be from another window moving over the form or a focus/minimize/maximize. It would depend on the application. You can add a simple counter, sort of like the example I gave, to see how many times it's being fired in a given situation. This value may be different in Remote Desktop environments, I have not tested that.

ddanbe, it could be that the window is being unfocused and refocused by the windows environment. Each one causes a Paint event to fire. Perhaps it quickly does it and you see those results. In my current test environment, I consistently see three events at startup, and then from there it varies depending what I do.
Reputation Points: 15
Solved Threads: 7
Newbie Poster
nelis is offline Offline
21 posts
since Jan 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Config.xml
Next Thread in C# Forum Timeline: Advantages of C# over C++





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC