예제 #1
0
 private void button_VisibleChanged(object sender, EventArgs e)
 {
     try
     {
         GxButton btn   = (GxButton)sender;
         bool     begin = false;
         int      j     = 0;
         int      width = 0;
         for (int i = 0; i < lstButton.Count; i++)
         {
             if (lstButton[i].Visible)
             {
                 if (!begin)
                 {
                     lstButton[i].Left = 0;
                     width            += lstButton[i].Width + GxConstants.CONTROL_DIS;
                     begin             = true;
                     j = i;
                 }
                 else
                 {
                     lstButton[i].Left = lstButton[j].Right + GxConstants.CONTROL_DIS;
                     width            += lstButton[i].Width + GxConstants.CONTROL_DIS;
                     j = i;
                 }
             }
         }
         this.Width = width;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Lỗi Exception (GXAddEdit, button_VisibleChanged)", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //base.OnVisibleChanged(e);
 }
예제 #2
0
파일: GxCommand.cs 프로젝트: Vocaoson/qlgx
 private void button_VisibleChanged(object sender, EventArgs e)
 {
     try
     {
         GxButton btn = (GxButton)sender;
         reOrderButtons();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Lỗi Exception (GXAddEdit, button_VisibleChanged)", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     //base.OnVisibleChanged(e);
 }