Monday, 21 January 2013

how to find another page control in a page

 public static class global
    {
        public static object obj = null;
    }

  private void nfrmItem_Load(object sender, EventArgs e)
        {
          
            global.obj = this.BtnDiamond;
        }

  private void chkDimond_CheckedChanged(object sender, EventArgs e)
        {
            Button btn = global.obj as Button;
            if (chkDimond.Checked)
                btn.Enabled = true;
            else
                btn.Enabled = false;
        }

No comments:

Post a Comment