Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I have an UI to show/hide some controls depending on different button events. Those controls are in different groups. Every group is at the same position of the form.

 

I tried to use two groupBox controls and place them at the same position. I thought I could set

groupBox1.Visible=false;

groupBox2.Visible=true;

 

to show groupBox2 and hide groupBox1. But as groupBox2 is automatically set as a subcontrol of groupBox1, all the area of those groupBox is blank!

 

Could you please tell me how to show/hide controls for my case? Thanks in advance!

Posted

Have you drawn one group box inside another, or have you dragged one group box into another?

 

Try drawing them away from each other (same size)

Then move groupbox1 where you want it

Then manually enter the x and y values into group box 2

 

Then see if the code works

Posted (edited)

It works! Thanks!

 

Before, I dropped the second groupBox from ToolBox into the same location of the first groupBox. So it seems VS.NET IDE treats the second groupBox as a child control of the first one.

 

If I did the above process like before and I added many controls into them, then I want to seperate the two groupBox controls, which property of the second groupBox should I change to seperate them?

Edited by slownet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...