Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a linkLabel inside a form c#, and there is a textbox created already ,but it is invisible,i want to make the textbox visible when i click on the linkLabel
how can i do this?
Posted
Comments
Bajirao_ 28-Oct-13 10:42am    
Show us what you have tried? put some code in question.

1 solution

First, in the Visual Studio Form Designer, double-click on the LinkLabel. Now, an event handler to the LinkClicked method is created, and now, you can edit the code of the yourLinkLabel_LinkClicked method:
C#
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
    yourTextBox.Visible = true;
}


[Edit]

If you want to make the text box invisible when clicking a second time, try this:
C#
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
    yourTextBox.Visible = !yourTextBox.Visible;
}
 
Share this answer
 
v3
Comments
Member 10220821 28-Oct-13 10:50am    
i tried it, it works fine, thank you.
but if i want to make it invisible again by click on the same linklabel
can i do this?
Thomas Daniels 28-Oct-13 10:59am    
I updated my answer.

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