Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to put help form in my software and i want that when i click on the question the answer will open below it.
In my form a link label is there for question an for answer there is a label.

i tried this
label1.visible=ture 
in the linkLabel_click event but it keeps the blank space in the form even when it is not visible.

I want that it should not keep the place of the label(answer) and when i click on the question the shows the answer.

Can any on help me??
Posted
Updated 5-Apr-13 23:27pm
v2

1 solution

I assume that you mean that when the lable is invlisible, it takes up no space on your form?
Invisible:
 -------  
|Button1|
 -------
 -------  
|Button2|
 -------
Visible:
 -------  
|Button1|
 -------
  Label
 ------- 
|Button2|
 -------

There is no automatic way to do that with winforms, unlike web pages. (Thankfully)
Think about it: web pages are not fixed size - they move and change with the browser. WinForms don't - you specify the size, and location of teh form, and you specify the size and location of each control within the form. If making a control invisible changed the placement of other controls, then the size of the form would (probably) also have to change - which would look very odd when compared to other applications.

You can do it, but you would have to manually move all controls "below" the label whenever you changed the visibility.

I wouldn't do it if I was you!
 
Share this answer
 
Comments
Tiwari Avinash 6-Apr-13 7:19am    
very nice explanation!!
Manoj Kumar Choubey 6-Apr-13 8:26am    
Nice explain.
Member 9487578 10-Apr-13 7:16am    
Ok i understood.. thank you for explanation.. :)
OriginalGriff 10-Apr-13 7:20am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900