mytonytiger
asked on
Paint Event Question
Using VB.NET:
How can I subscribe to the "BeginPaint" and "EndPaint" events of a control or form with managed code?
Thanks,
Tony
How can I subscribe to the "BeginPaint" and "EndPaint" events of a control or form with managed code?
Thanks,
Tony
ASKER
I'm interested in captureing the event for panel control so I can reset the scroll bars to the position they were in before the paint event.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm trying to find the constants now, but so far no luck.
if you can find them, please post them. Then I can check out the solution
Thanks.
if you can find them, please post them. Then I can check out the solution
Thanks.
ASKER
Yes, I had seen this... but no reference to a "BeforePaint" or "AfterPaint" event.
So, I've done this and it seems to be working.
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = 15 Then
'Do code before paint here.
End If
MyBase.WndProc(m)
If m.Msg = 15 Then
'Do Code after paint here.
End If
End Sub
So, I've done this and it seems to be working.
Protected Overrides Sub WndProc(ByRef m As Message)
If m.Msg = 15 Then
'Do code before paint here.
End If
MyBase.WndProc(m)
If m.Msg = 15 Then
'Do Code after paint here.
End If
End Sub
Yeah I assumed that there was actually some Windows Message that you were aware of trying to hook into your application.
ASKER
well, there are several pages in the net referring to a "BeginPaint" and and "EndPaint" event. But, I guess they aren't actual windows messages.
ASKER
Thanks for the help. I do appreciate it.
ASKER
I'm using Visual Studio 2005, hence, .NET 2.0