Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Custom user control in window form and first i don't want to saw my user control after click on button i want my user control visible true and for this i want below coding;

ctlUser is my user control ID.

On page load :
C#
ctlUser.visible=false;

On Button click event:
C#
ctlUser.visible=true;
Posted
Updated 17-Jun-13 21:39pm
v2
Comments
Pheonyx 18-Jun-13 3:39am    
Is the code you have kinda written there not working for you? Do you get any errors?

Saying "I want" is not very polite, people who "want" stuff generally do not get.
jaideepsinh 18-Jun-13 3:42am    
Thank's for reply,
It not generate any error but it is not visible true and false.
Pheonyx 18-Jun-13 3:45am    
What happens it you set it to be visible all the time, can you see it?
Pheonyx 18-Jun-13 3:45am    
Also, is this a Windows Form application or a Web Application? because in the question you say "window form" but in the body you talk about "page load".
jaideepsinh 18-Jun-13 3:52am    
By default i make it visible false but after click i make it visible true.
But all time it is visible false. And this one is window application.

1 solution

Normally it will show the usercontrol if you make the property visible in button click event
that means ctlUser.visible=true; is ok

But check any other controls are there in the form above user control
or
check the user control is visible or not by changing usercontrol background color...
or
check the execution flow is deviating to some other place and changing the property ...etc.

else post your code part..
 
Share this answer
 
Comments
jaideepsinh 19-Jun-13 1:00am    
I am using image control on same form and above on user control.Is that accrue problem.
Sadique KT 19-Jun-13 1:36am    
just check by changing locations of both controls in same form..
jaideepsinh 19-Jun-13 14:08pm    
I solve it with this code ctlUser1.Visible = true;
Thank's For response.

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