Link to home
Start Free TrialLog in
Avatar of brgdotnet
brgdotnetFlag for United States of America

asked on

Where to place code in the code behind of my form to hide a control

I have a VB.net windows form with a splitter control on it. I would like to hide one of the panels of the splitter control. From what I have read this needs to be done in the code behind for the form containing the control(I think ?). So my question is where at in the code behind should I place the code to hide the control? Below is an example of the code.

splitContainer1.Panel2.Collapsed = true;
splitContainer1.Panel2.Hide();
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Hi brgdotnet,

Open the form and press F7, a file will open with VB.Net code. That is your code behind of a given form.
Now in code behind, on any given control's event you can put your code.

If you can tell me when you want to hide the panel, I will be able to tell you where to put the code.

Regards,
Chinmay.
Avatar of brgdotnet

ASKER

Hi Chinmay, I need to hide the panel before the form is displayed. I know in asp.net there is the init method. However in web forms, I don't know of such an initialization method. It sounds like you might know, or possibly another expert.
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks