private static void InitializeComponent() { // Create a new instance of the form. frmInputDialog = new XtraForm(); lblPrompt = new Label(); btnOK = new SimpleButton(); btnCancel = new SimpleButton(); txtInput = new TextEdit(); frmInputDialog.SuspendLayout(); // // lblPrompt // lblPrompt.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom) | AnchorStyles.Left) | AnchorStyles.Right))); lblPrompt.Location = new Point(12, 9); lblPrompt.Name = "lblPrompt"; lblPrompt.Size = new Size(302, 82); lblPrompt.TabIndex = 3; // // btnOK // btnOK.DialogResult = DialogResult.OK; btnOK.Location = new Point(326, 8); btnOK.Name = "btnOK"; btnOK.Size = new Size(64, 24); btnOK.TabIndex = 1; btnOK.Text = "Đồng ý"; btnOK.Click += new EventHandler(btnOK_Click); // // btnCancel // btnCancel.DialogResult = DialogResult.Cancel; btnCancel.Location = new Point(326, 40); btnCancel.Name = "btnCancel"; btnCancel.Size = new Size(64, 24); btnCancel.TabIndex = 2; btnCancel.Text = "Đóng"; btnCancel.Click += new EventHandler(btnCancel_Click); // // txtInput // txtInput.Location = new Point(8, 100); txtInput.Name = "txtInput"; txtInput.Size = new Size(379, 20); txtInput.TabIndex = 0; txtInput.Text = ""; // // InputBoxDialog // frmInputDialog.AutoScaleBaseSize = new Size(5, 13); frmInputDialog.ClientSize = new Size(398, 128); frmInputDialog.Controls.Add(txtInput); frmInputDialog.Controls.Add(btnCancel); frmInputDialog.Controls.Add(btnOK); frmInputDialog.Controls.Add(lblPrompt); frmInputDialog.FormBorderStyle = FormBorderStyle.FixedDialog; frmInputDialog.MaximizeBox = false; frmInputDialog.MinimizeBox = false; frmInputDialog.Name = "InputBoxDialog"; frmInputDialog.ResumeLayout(false); }
// Hàm add checkbox vào form private void AddCheckbox(XtraForm mainform, XtraForm form) { int w = form.Width; int h = form.Height; form.Size = new System.Drawing.Size(w, h + 30); form.SuspendLayout(); // Khởi tạo checkbox for add DevExpress.XtraEditors.CheckEdit checkEdit1 = new DevExpress.XtraEditors.CheckEdit(); checkEdit1.Location = new System.Drawing.Point(13, h - 30);//subheader checkEdit1.Name = "_" + form.GetType().FullName; checkEdit1.Properties.Caption = "Hiện màn hình này ở các lần sau."; checkEdit1.Size = new System.Drawing.Size(w, 19); checkEdit1.TabIndex = 4; checkEdit1.Checked = true; checkEdit1.Click += new System.EventHandler(Checkbox_Click); form.Controls.Add(checkEdit1); form.ResumeLayout(false); form.PerformLayout(); }