Jump to content
  • Advertisement
Sign in to follow this  
GameMasterXL

C# contractable groupbox problem

This topic is 4650 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi i have this control i download which is a contractable groupbox since .net dosn't support this feature and i want it like the windows contractable groupboxes were when you expand one it pushes the rest downwards and then collaps when the rest move up into the space the other one took. I tried auto size on the control and that seemed to be the solution but then it stoped the control from collapsing since it won't move past any controls within it how can i bypass this?

Share this post


Link to post
Share on other sites
Advertisement
Have you tried playing with the visible property of the controls contained within the groupbox? After setting visible to false, the box might collapse the way you want.

*EDIT* hey, cool it works! just tried it. You have to set the autosizemode to "GrowAndShrink" for it to work. Good luck.

Share this post


Link to post
Share on other sites
All I did was take a System.Windows.Forms.GroupBox and I added three textboxes to it. Next I added two command buttons, one to show, one to hide. The 'hide' button set the visibility properties of the text boxes to false, the other button set it to true. When the text boxes were hidden, the GroupBox collapsed. Again, I had to set the autosizemode propert of the GroupBox to GrowAndShrink. If you're using a custom control to do this, you should probably have the base class inherit from GroupBox rather than Usercontrol. Otherwise odd things start to happen when rendering the control. I just had went through that recently.

Share this post


Link to post
Share on other sites
Do you have MSN to contact you on? if so i will send you the guys code since he distributed it for free.

Edit: i never thought of hiding them first lol.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!