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