private void AddButtonsToList(DevExpress.XtraEditors.Controls.EditorButtonCollection listButtons) { foreach (DevExpress.XtraEditors.Controls.EditorButton b in listButtons) { if (b.Caption.ToLower() == "Refresh".ToLower()) { return; } } DevExpress.Utils.ToolTipTitleItem toolTipTitleItem1 = new DevExpress.Utils.ToolTipTitleItem(); System.Drawing.Image refreshIcon = DevExpress.Images.ImageResourceCache.Default.GetImage("grayscaleimages/actions/refresh_16x16.png"); DevExpress.Utils.ToolTipItem toolTipItem1 = new DevExpress.Utils.ToolTipItem(); DevExpress.Utils.SuperToolTip superToolTip1 = new DevExpress.Utils.SuperToolTip(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject(); toolTipTitleItem1.Appearance.Image = refreshIcon; toolTipTitleItem1.Appearance.Options.UseImage = true; toolTipTitleItem1.Image = refreshIcon; toolTipTitleItem1.Text = "Refresh list from database"; toolTipItem1.LeftIndent = 6; toolTipItem1.Text = "Press this button only when you want to retrieve new inserted rows from database " + ""; superToolTip1.Items.Add(toolTipTitleItem1); superToolTip1.Items.Add(toolTipItem1); DevExpress.XtraEditors.Controls.EditorButton refreshButton = new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Refresh", -1, true, true, false, DevExpress.XtraEditors.ImageLocation.MiddleCenter, refreshIcon, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, "", null, superToolTip1, true); listButtons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { refreshButton /*,new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)*/ }); // }
private void AnHienButtonAddHoaDon(bool trangThai) { DevExpress.XtraEditors.Controls.EditorButtonCollection buttons = txtTienCoc.Properties.Buttons; foreach (EditorButton item in buttons) { item.Visible = trangThai; } }