Handle panel resizing event

Here's my delimma. I have a 3rd party control resize event that I want to suppress when the container panel is resizing. A form conveniently has a resizebegin and resizeend event. With that I can set a flag to on in the begin and off in the end event. In the controls resize event I can suppress functionality when the flag is on. A panel does not expose a resizing or resized event. Any ideas on how I could do this? PS This can't fire off the forms resiing events and the form may have 2 or more panels with splitbars and the resizing of the splitbar may cause the panels to resize.
glenn_rAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dlmichenerCommented:
Is the control docked or anchored?  Either way, you could turn off the dock or anchor attribute when the form is resized, and turn it back on after the form has resized.  Sounds like there would be plenty of potential for the form getting out of sync though.
0
glenn_rAuthor Commented:
the panel dockstate is filled ot the panel. Its a container for some 3rd party controls. These controls have resize events that I need to suppress. For brevity, the user can resize the control which i want to handle but the 3rd party control resize event also gets raised when its container resizes, which I want to ignore. I have no way of telling what raised the event (user or panel). Hope that clarifys my needs.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
Do the 3rd party controls expose a Handle property?
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

glenn_rAuthor Commented:
no the 3rd party control only exposes a sizechanged event.
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
I watched the windows messages sent to a Panel during resize due to Anchor/Dock and I don't see anything that would allow an easy ResizeBegin/ResizeEnd.  =\

One hack would be to use a Timer with an Interval of one second (1000).  Now, whenever the Resize() event for the Panel fires, we Stop() the Timer and Start() it again.  If the Panel is resized continously (or in rapid succession) then the Tick() event will not fire.  Once the resizing is "complete" we can repaint the Panel.

Here's the fuzzy part though.  Without a Handle we can't directly suppress the painting of the 3rd party control.  We could try suppressing the Panel repainting using SendMessage() and WM_SETREDRAW to see if that is enough to prevent the 3rd party control from repainting as well.

This could be done by using Inheriting from NativeWindow or by Inheriting from Panel.  Do you want to try this approach?
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
*The Timer would normally be in the OFF state and only turned On once a Resize event is received.  When the Tick() event fires (because no Resize events have occurred in the last second) then we Repaint and turn the Timer back OFF so we don't have constant Tick() events.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
glenn_rAuthor Commented:
Good advice. I don't think I have to go that far. I could simple create variable and turn on a flag for 1 second. This creates a lag period in which I could check from the the hosted control resize event if its on and suppress it, or otherwise let it fly. I'll give it a whirl. Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.