Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a form in C# windows application. In this form I have a textbox and button. When I clicked this button I have to show that textbox otherwise I have to hide it.

I have done this by using the property "Visible". but the space for this textbox is still available there. I want to hide that space also.

Thanks,
Velkumar
Posted
Updated 31-May-12 4:14am
v2
Comments
Shahin Khorshidnia 31-May-12 10:21am    
Hi, What do you mean with "the space for this textbox"? Do you mean you want to collapse the textbox and other controls occupy its place after hiding? If yes then you need to write a code for it.

I am not sure but i think you can use flowlayoutpanel to achieve this. you will perhaps need to remove and add the textbox instead of hiding it.
 
Share this answer
 
Comments
Velkumar Kannan 1-Jun-12 1:17am    
Could you give any samples.
Set the Textbox BackGround Property same as your form then the space wont be seen
 
Share this answer
 
Comments
Shahin Khorshidnia 31-May-12 10:24am    
Hello, I didn't vote. But do you mean BackColor? If yes, then why? When you set the Visible of a control to false then it will be hide with all its Back and ForeColors!

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