本文介绍了我不能在Checkedchangedenent上显示/隐藏Lblexceeding。我错了哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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;
        }

推荐答案

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
    if (this.checkBox1.Checked) 
    { 
        ((System.Windows.Forms.Control)(lblExceeding)).Visible = true;
    } 
    else 
    { 
         ((System.Windows.Forms.Control)(lblExceeding)).Visible = false;
     }
}


这篇关于我不能在Checkedchangedenent上显示/隐藏Lblexceeding。我错了哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 20:00