コード例 #1
0
        public static string QuickShow(string TitleMessage, string Message, AutoCompleteSource acs, IWin32Window owner = null)
        {
            _InputBox ibx = new _InputBox();

            ibx.Show(owner, TitleMessage, Message, acs);
            return(ibx.Value);
        }
コード例 #2
0
ファイル: YoutubeTextbox.cs プロジェクト: l4km47/Youtube-skin
 public YoutubeTextbox()
 {
     SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
     DoubleBuffered = true;
     UpdateStyles();
     _textAlign             = HorizontalAlignment.Left;
     _maxLength             = 32767;
     _readOnly              = false;
     _useSystemPasswordChar = false;
     _watermarkText         = string.Empty;
     _image = null;
     _state = HelperMethods.MouseMode.Normal;
     _autoCompleteSource = AutoCompleteSource.None;
     _autoCompleteMode   = AutoCompleteMode.None;
     _multiline          = false;
     _lines                  = null;
     Font                    = new Font("Segoe UI", 10);
     T.Multiline             = false;
     T.Cursor                = Cursors.IBeam;
     T.BackColor             = Colors.White;
     T.ForeColor             = Colors.Silver;
     T.BorderStyle           = BorderStyle.None;
     T.Location              = new Point(7, 8);
     T.Font                  = Font;
     T.UseSystemPasswordChar = UseSystemPasswordChar;
     Size                    = new Size(135, 30);
     if (Multiline)
     {
         T.Height = Height - 11;
     }
     else
     {
         Height = T.Height + 11;
     }
 }
コード例 #3
0
 void T_Defaults()
 {
     _WatermarkText         = string.Empty;
     _UseSystemPasswordChar = false;
     _ReadOnly               = false;
     _MaxLength              = 32767;
     _TextAlign              = HorizontalAlignment.Left;
     State                   = MouseMode.Normal;
     _AutoCompleteMode       = AutoCompleteMode.None;
     _AutoCompleteSource     = AutoCompleteSource.None;
     _Lines                  = null;
     _Multiline              = false;
     T.Multiline             = _Multiline;
     T.Cursor                = Cursors.IBeam;
     T.BackColor             = BackColor;
     T.ForeColor             = ForeColor;
     T.BorderStyle           = BorderStyle.None;
     T.Location              = new Point(7, 8);
     T.Font                  = Font;
     T.UseSystemPasswordChar = UseSystemPasswordChar;
     if (Multiline)
     {
         T.Height = Height - 11;
     }
     else
     {
         Height = T.Height + 11;
     }
 }
コード例 #4
0
ファイル: DGV_TextBox.cs プロジェクト: infobook/Tools4
 public DGV_TextBoxCell()
     : base()
 {
     pAC = null;
       pACMode = AutoCompleteMode.None;
       pACSource = AutoCompleteSource.None;
 }
コード例 #5
0
 public static ComboBox SetComboBox(ComboBox cbo, String DisplayMember, String ValueMember,
                                    AutoCompleteSource AutoSource, AutoCompleteMode AutoMode, ComboBoxStyle DropStyle)
 {
     cbo.ValueMember        = ValueMember;
     cbo.DisplayMember      = DisplayMember;
     cbo.AutoCompleteSource = AutoSource;
     cbo.AutoCompleteMode   = AutoMode;
     cbo.DropDownStyle      = DropStyle;
     return(cbo);
 }
コード例 #6
0
		public static void MakeAutoComplete(
			ComboBoxEdit comboBoxEdit,
			AutoCompleteMode autoCompleteMode,
			AutoCompleteSource autoCompleteSource)
		{
			// http://community.devexpress.com/forums/p/81601/280039.aspx

			var tx = comboBoxEdit.MaskBox;
			tx.AutoCompleteSource = autoCompleteSource;
			tx.AutoCompleteMode = autoCompleteMode;
		}
コード例 #7
0
        public static void MakeAutoComplete(
            ComboBoxEdit comboBoxEdit,
            AutoCompleteMode autoCompleteMode,
            AutoCompleteSource autoCompleteSource)
        {
            // http://community.devexpress.com/forums/p/81601/280039.aspx

            var tx = comboBoxEdit.MaskBox;

            tx.AutoCompleteSource = autoCompleteSource;
            tx.AutoCompleteMode   = autoCompleteMode;
        }
コード例 #8
0
        public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
        {
            StandardValuesCollection stdv = base.GetStandardValues(context);

            AutoCompleteSource[] arr = new AutoCompleteSource[stdv.Count];
            stdv.CopyTo(arr, 0);
            AutoCompleteSource[] arr2 = Array.FindAll(arr, delegate(AutoCompleteSource value) {
                // No "ListItems" in a TextBox.
                return(value != AutoCompleteSource.ListItems);
            });
            return(new StandardValuesCollection(arr2));
        }
コード例 #9
0
 public static ComboBoxEx SetComboBoxEx(ComboBoxEx cbo, DataTable dt, String DropDownColumns, String DisplayMember,
                                        String ValueMember, AutoCompleteSource AutoSource, AutoCompleteMode AutoMode, ComboBoxStyle DropStyle)
 {
     cbo.DataSource         = dt;
     cbo.DisplayMember      = DisplayMember;
     cbo.DropDownColumns    = DropDownColumns;
     cbo.ValueMember        = ValueMember;
     cbo.AutoCompleteSource = AutoSource;
     cbo.AutoCompleteMode   = AutoMode;
     cbo.DropDownStyle      = DropStyle;
     return(cbo);
 }
コード例 #10
0
 /// <summary>
 /// Sets the automatic complete source.
 /// </summary>
 /// <param name="textBox">The text box.</param>
 /// <param name="value">The value.</param>
 public static void SetAutoCompleteSource(this TextBox textBox, AutoCompleteSource value)
 {
     if (textBox.InvokeRequired)
     {
         textBox.BeginInvoke(new MethodInvoker(() => textBox.SetAutoCompleteSource(value)));
     }
     else
     {
         textBox.AutoCompleteSource = value;
         textBox.Refresh();
     }
 }
コード例 #11
0
 public void AutoCompleteSource(AutoCompleteSource autoCompleteSource)
 {
     if (_comboBox != null)
     {
         if (_comboBox.InvokeRequired)
         {
             delegateAutoCompleteSource deleg = new delegateAutoCompleteSource(AutoCompleteSource);
             _comboBox.Invoke(deleg, new object[] { autoCompleteSource });
         }
         else
         {
             _comboBox.AutoCompleteSource = autoCompleteSource;
         }
     }
 }
コード例 #12
0
 internal bool Show(IWin32Window owner, string TitleMessage, string Message, AutoCompleteSource acs)
 {
     comboBox1.Visible = true;
     inputtype         = type.dropdown;
     comboBox1.Focus();
     this.Text   = TitleMessage == null ? "Input Value" : TitleMessage;
     label1.Text = Message == null ? "Enter Value:" : Message;
     comboBox1.Items.Clear();
     comboBox1.AutoCompleteSource = acs;
     comboBox1.AutoCompleteMode   = AutoCompleteMode.Suggest;
     if (owner == null)
     {
         return(ShowDialog() == DialogResult.OK);
     }
     return(ShowDialog(owner) == DialogResult.OK);
 }
        /// <summary>
        /// Constructor for the KryptonDataGridViewComboBoxCell cell type
        /// </summary>
        public KryptonDataGridViewComboBoxCell()
        {
            // Create a thread specific KryptonComboBox control used for the painting of the non-edited cells
            if (_paintingComboBox == null)
            {
                _paintingComboBox = new KryptonComboBox();
                _paintingComboBox.SetLayoutDisplayPadding(new Padding(0, 1, 1, 0));
                _paintingComboBox.StateCommon.ComboBox.Border.Width = 0;
                _paintingComboBox.StateCommon.ComboBox.Border.Draw  = InheritBool.False;
            }

            _dropDownStyle      = ComboBoxStyle.DropDown;
            _maxDropDownItems   = 8;
            _dropDownHeight     = 200;
            _dropDownWidth      = 121;
            _autoCompleteMode   = AutoCompleteMode.None;
            _autoCompleteSource = AutoCompleteSource.None;
            _displayMember      = string.Empty;
            _valueMember        = string.Empty;
        }
コード例 #14
0
        private void OnSelectedItemChanged(object sender, EventArgs eventArgs)
        {
            try
            {
                if (SelectedItem != null &&
                    !IgnoreAutoCompleteSourceCheck &&
                    (AutoCompleteSource == null || (AutoCompleteSource != null && !AutoCompleteSource.Contains(SelectedItem))))
                {
                    // Force the item to null if the source check is enabled and it fails the check
                    SelectedItem = null;
                    return;
                }

                OnSelectionChanged();
                OnPropertyChanged();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
コード例 #15
0
 public bool Show(string TitleMessage, string Message, AutoCompleteSource acs, IWin32Window owner = null)
 {
     return(_ibx.Show(owner, TitleMessage, Message, acs));
 }
コード例 #16
0
        public static DataGridViewComboBoxExColumn setGridComboBox(DataTable dt, String DisplayMember,
                                                                   String ValueMember, AutoCompleteSource AutoSource, AutoCompleteMode AutoMode, ComboBoxStyle DropStyle)
        {
            DataGridViewComboBoxExColumn cboCol = new DataGridViewComboBoxExColumn();

            cboCol.DataSource         = dt;
            cboCol.DisplayMember      = DisplayMember;
            cboCol.ValueMember        = ValueMember;
            cboCol.AutoCompleteSource = AutoSource;
            cboCol.AutoCompleteMode   = AutoMode;
            cboCol.DropDownStyle      = DropStyle;
            return(cboCol);
        }
コード例 #17
0
        //private bool AlreadyExists(string klassename)
        //{
        //    if (con.ConnectError()) return false;
        //    string RawCommand = "SELECT k_id from [dbo].[t_s_klassen] where k_bezeichnung=@0";
        //    SqlDataReader dr = con.ExcecuteCommand(RawCommand, klassename);
        //    dr.Read();
        //    if (dr.HasRows)
        //    {
        //        dr.Close();
        //        con.Close();
        //        return true;
        //    }
        //    else
        //    {
        //        dr.Close();
        //        con.Close();
        //        return false;
        //    }
        //}

        /// <summary>
        /// fills a combobox with data
        /// </summary>
        /// <param name="cb"></param>
        /// <param name="value"></param>
        public void FillCombobox(ref AdvancedComboBox cb, object value, AutoCompleteSource autoCompleteSource = AutoCompleteSource.None)
        {
            c.FillCombobox(ref cb, value, ref table, autoCompleteSource);
            cb.SelectedValue = value;
        }
コード例 #18
0
 //=====================================================================
 /// <summary>
 /// Constructor
 /// </summary>
 public AutoCompleteTextBoxCell()
 {
     source = AutoCompleteSource.None;
 }
コード例 #19
0
ファイル: UISetter.cs プロジェクト: rikscen/vglTMS
 public static void SetComboBox(this ComboBox cbo, DataTable dt, string DisplayMember, string ValueMember, AutoCompleteSource AutoSource = AutoCompleteSource.ListItems,
                                AutoCompleteMode AutoMode = AutoCompleteMode.SuggestAppend, ComboBoxStyle DropStyle = ComboBoxStyle.DropDownList)
 {
     cbo.DisplayMember      = DisplayMember;
     cbo.ValueMember        = ValueMember;
     cbo.AutoCompleteSource = AutoSource;
     cbo.AutoCompleteMode   = AutoMode;
     cbo.DropDownStyle      = DropStyle;
     cbo.DataSource         = dt;
     cbo.SelectedIndex      = -1;
 }
コード例 #20
0
 public void AddColumn(string pName, string pDBFieldName = "", string pSPAdd = "", string pSPUpp = "", string pSPDel = "", bool pSortable = false,
                       bool pIsFlag = false, bool pLocked = false, string pQuery = "", int pWidth = 0, string pAlignment = "", string pAttr = "", AutoCompleteMode aMode = AutoCompleteMode.None, AutoCompleteSource aSource = AutoCompleteSource.None, string aQuery = "", bool pPrint = false, bool pVisible = true)
 {
     if (pQuery == "")
     {
         var _Col = new CtlVSTextBoxColumn()
         {
             Name       = pName,
             HeaderText = pName,
             //Colnumber = pColnumber,
             DBField          = pDBFieldName == "" ? pName : pDBFieldName,
             DataPropertyName = pName,
             Parent           = this,
             Attr             = pAttr,
             Add                = pSPAdd != "",
             Upp                = pSPUpp != "",
             Del                = pSPDel != "",
             SPAddParamName     = pSPAdd,
             SPDelParamName     = pSPDel,
             SPUppParamName     = pSPUpp,
             IsFlag             = pIsFlag,
             Locked             = pLocked,
             ReadOnly           = pLocked,
             Width              = pWidth,
             Alignment          = pAlignment,
             Sortable           = pSortable,
             LinkedControl      = null,
             AutoSizeMode       = pWidth == 0 ? DataGridViewAutoSizeColumnMode.DisplayedCells : DataGridViewAutoSizeColumnMode.None,
             AutoCompleteMode   = aMode,
             AutoCompleteSource = aSource,
             AutoCompleteQuery  = aQuery,
             Print              = pPrint,
             Visible            = pVisible
         };
         _Col.SetQuery(pQuery);
         Columns.Add(_Col);
     }
     else
     {
         var _Col = new CtlVSComboColumn()
         {
             Name       = pName,
             HeaderText = pName,
             //Colnumber = pColnumber,
             DBField          = pDBFieldName == "" ? pName : pDBFieldName,
             DataPropertyName = pName,
             Parent           = this,
             CellTemplate     = new DataGridViewComboBoxCell(),
             Attr             = pAttr,
             Add                = pSPAdd != "",
             Upp                = pSPUpp != "",
             Del                = pSPDel != "",
             SPAddParamName     = pSPAdd,
             SPDelParamName     = pSPDel,
             SPUppParamName     = pSPUpp,
             IsFlag             = pIsFlag,
             Locked             = pLocked,
             ReadOnly           = pLocked,
             Width              = pWidth,
             Alignment          = pAlignment,
             Sortable           = pSortable,
             LinkedControl      = null,
             AutoSizeMode       = pWidth == 0 ? DataGridViewAutoSizeColumnMode.DisplayedCells : DataGridViewAutoSizeColumnMode.None,
             DisplayStyle       = DataGridViewComboBoxDisplayStyle.DropDownButton,
             AutoComplete       = true,
             AutoCompleteMode   = aMode,
             AutoCompleteSource = aSource,
             AutoCompleteQuery  = aQuery,
             Print              = pPrint,
             Visible            = pVisible
         };
         _Col.SetQuery(pQuery);
         Columns.Add(_Col);
     }
 }
コード例 #21
0
        public void AddColumn(string pName, EspackFormControl pLinkedControl, string pSPAdd = "", string pSPUpp = "", string pSPDel = "", AutoCompleteMode aMode = AutoCompleteMode.None, AutoCompleteSource aSource = AutoCompleteSource.None, string aQuery = "", bool pPrint = false, bool pVisible = true)
        {
            var _Col = new CtlVSTextBoxColumn()
            {
                Name       = pName,
                HeaderText = pName,
                //Colnumber = pColnumber,
                DBField          = pName,
                DataPropertyName = pName,
                CellTemplate     = new DataGridViewTextBoxCell(),
                Attr             = "",
                Add                = pSPAdd != "",
                Upp                = pSPUpp != "",
                Del                = pSPDel != "",
                SPAddParamName     = pSPAdd,
                SPDelParamName     = pSPDel,
                SPUppParamName     = pSPUpp,
                IsFlag             = false,
                Locked             = true,
                ReadOnly           = true,
                Width              = 0,
                Alignment          = "",
                Sortable           = false,
                LinkedControl      = pLinkedControl,
                AutoSizeMode       = DataGridViewAutoSizeColumnMode.DisplayedCells,
                AutoCompleteMode   = aMode,
                AutoCompleteSource = aSource,
                AutoCompleteQuery  = aQuery,
                Print              = pPrint,
                Visible            = pVisible
            };

            _Col.SetQuery("");
            Columns.Add(_Col);
        }
コード例 #22
0
ファイル: TextBox.cs プロジェクト: Profit0004/mono
		public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
		{
			StandardValuesCollection stdv = base.GetStandardValues(context);
			AutoCompleteSource[] arr = new AutoCompleteSource[stdv.Count];
			stdv.CopyTo(arr, 0);
			AutoCompleteSource[] arr2 = Array.FindAll(arr, delegate (AutoCompleteSource value) {
				// No "ListItems" in a TextBox.
				return value != AutoCompleteSource.ListItems;
			});
			return new StandardValuesCollection(arr2);
		}
コード例 #23
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        public AutoCompleteTextBoxCell()
        {
            source = AutoCompleteSource.None;
        }
コード例 #24
0
ファイル: Command.cs プロジェクト: greenDevHub/greenLib
 /// <summary>
 /// fills a combobox with data
 /// </summary>
 /// <param name="cb"></param>
 /// <param name="value"></param>
 /// <param name="adapter"></param>
 /// <param name="table"></param>
 public void FillCombobox(ref AdvancedComboBox cb, object value, ref DataTable table, AutoCompleteSource autoCompleteSource = AutoCompleteSource.None)
 {
     if (cb.AutoCompleteSource != autoCompleteSource)
     {
         cb.AutoCompleteSource = autoCompleteSource;
     }
     table = FillObject();
     if (table == null)
     {
         return;
     }
     cb.DataSource    = table;
     cb.ValueMember   = FieldId;
     cb.DisplayMember = FieldName;
     cb.SelectedValue = value;
 }