Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How do I show / Hide label from class file using winform c#?
Posted

1 solution

Hi,

[LableId].Visible = true / false ;
 
Share this answer
 
v2
Comments
Sathish km 10-Sep-15 1:30am    
i also used, but i hav some issue. the chckbox i placed into panel user control.
Suvabrata Roy 10-Sep-15 1:31am    
show me your code
Sathish km 10-Sep-15 2:00am    
public TemplateForm(bool bChecked)
{
InitializeComponent();

//lblExceeding.Visible = false;
if (bChecked == true)
value = 1;
else
value = 0;
((System.Windows.Forms.Control)(lblExceeding)).Visible = bChecked;
}


void CheckedChangedEnent(int iIndex, bool bChecked)
{
//pUserControl1.objList[iIndex].blnIsChecked = bChecked;

if (iIndex == 0)
pUserControl1.blnExceedingClick = bChecked;

//TemplateForm tmpForm = new TemplateForm(null, null, null, null, null, null, null, null, null, true);
TemplateForm tmpForm = new TemplateForm(bChecked);
if (iIndex != 0)
mDataGridView.Columns[iIndex-1].Visible = bChecked;
//if (mCheckedListBox.Items.Count)
//{
//}
//tmpForm.lblExceeding.Visible = bChecked;
((System.Windows.Forms.Control)(tmpForm.lblExceeding)).Visible = bChecked;
}
Suvabrata Roy 10-Sep-15 2:04am    
why you always cast lblExceeding to Control ?

you can directly set visible property of lblExceeding.Visible
Sathish km 10-Sep-15 2:36am    
i tried ur points but no improve

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