By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Form events problem

P: 13

I have a problem. I have to change the size of a control added to a Form when the user resizes the Form. I use the Resize event and change the size of the control in the method which is called with the Resize event. So I implemented the docking behaving of the control because it is a part of a third-party library and it doesn't have the docking property. But if the user changes the size of a Form that the control doesn't fit in the form after resizing so the width must decrease, the control totaly collapses. I solved this with use of the ResizeBegin event. When it is called, the controls size changes to width=1, height=1 and then when the Resize event is triggered, the control get resized to the proper size. Everything goes well but the problem still remains when the user maximizes the Form and then Restores it. In that case the ResizeBegin event isn't triggered and the control does not resize to widht=1, height=1. So what I want is to resize the control to widht=1, height=1 before the Form gets resized when the user Restores the Forms size but I didn't find any event that will do this job. My problem could be solved by overloading a method that is called when the user wants to Restore the Form's size but I didn't find any to do this.

Thanks for any suggestions!

Mar 17 '08 #1
Share this Question
Share on Google+
6 Replies

Expert 5K+
P: 7,872
Does that control not have the Anchor property?
Mar 17 '08 #2

P: 13
Unfortunately no. It's a part of a third-party library.
Mar 17 '08 #3

Expert 5K+
P: 7,872
Hmm so that thirdparty is wrapping some native win32 components and they're not managed controls?
Mar 17 '08 #4

P: 13
I'm using the toolStripEx control from the Syncfusion Essential Studio. I wrote them about docking for this control, they said that it has not implemented. Maybe It'll be in the future :).

I'm searching for a work-around. I could fire a trigger befor the form gets Resized or to overload/re-implement a method that Resizes the Form but don't know how could be this reachable :\.
Mar 17 '08 #5

Expert 5K+
P: 7,872
You can try checking WindowState (minimized/maximized/etc) and see if this helps?

What features does toolStripEx offer over the .NET toolstrip?
Mar 17 '08 #6

P: 13
Actually it has docking option but it doesn't work.

I tried with maximized state but it is not helpful to check it. I just have to catch the moment before the Form gets restored.

I searched the functionality of the control (it's called toolStripEx) for any property that would not let the control to collapse if the parent container gets smaller than the control itself.

:\ damnit
Mar 17 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.