Пример #1
0
        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)*/ });

            //
        }
        public RepositoryItemSearchButtonEdit()
        {
            this.Buttons.Clear();
            var ebtnSet = new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph)
            {
                Caption = "选",
                Tag     = "select"
            };//设置用户字段

            this.Buttons.Add(ebtnSet);

            this.ButtonClick += RepositoryItemSearchButtonEdit_ButtonClick;

            if (Common.CheckDesingModel.IsDesingMode)
            {
                return;
            }
            KeyDown += RepositoryItemSearchTextEdit_KeyDown;
            this.ValidateOnEnterKey = true;

            this.Validating        += RepositoryItemSearchButtonEdit_Validating;
            this.EditValueChanging += RepositoryItemSearchButtonEdit_EditValueChanging;
        }
Пример #3
0
        public LabelGridEdit()
            : base()
        {
            base.EditValue = null;
            base.Text      = string.Empty;
            base.Properties.TextEditStyle =
                DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            base.Properties.View.OptionsBehavior.Editable            = false;
            base.Properties.View.OptionsBehavior.AutoPopulateColumns = false;
            base.Properties.View.Appearance.SelectedRow.BackColor    = Color.FromArgb(70, 80, 20, 20);
            base.Properties.View.Appearance.FocusedRow.BackColor     = Color.FromArgb(70, 80, 20, 20);
            base.Properties.NullText = string.Empty;
            base.Properties.Buttons.Clear();
            //LabelButton = new EditorButton(ButtonPredefines.Glyph);
            //LabelButton.IsLeft = true;
            //LabelButton.Visible = true;
            //LabelButton.Width = 50;
            //LabelButton.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;
            //base.Properties.Buttons.Add(LabelButton);
            base.Properties.Buttons.Add(new EditorButton {
                Kind = ButtonPredefines.Combo
            });

            base.Properties.Buttons.Add(_ClearButton = new DevExpress.XtraEditors.Controls.EditorButton {
                Caption = ClearButtonText
                ,
                Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Delete
                ,
                ToolTip = ClearButtonText
                ,
                Visible = ShowClearButton
            });

            base.Text = string.Empty;
            base.Properties.ButtonClick += Properties_ButtonClick;
        }
        private string GetButtonCaption(GridView view, int rowHandle, GridColumn column, DevExpress.XtraEditors.Controls.EditorButton button)
        {
            GetButtonCaptionEventArgs args = new GetButtonCaptionEventArgs(button, column, rowHandle, view);

            RaiseGetButtonCaptionEvent(args);
            return(args.ButtonText);
        }