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); }
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; } }
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; } }
public DGV_TextBoxCell() : base() { pAC = null; pACMode = AutoCompleteMode.None; pACSource = AutoCompleteSource.None; }
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); }
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; }
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)); }
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); }
/// <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(); } }
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; } } }
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; }
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); } }
public bool Show(string TitleMessage, string Message, AutoCompleteSource acs, IWin32Window owner = null) { return(_ibx.Show(owner, TitleMessage, Message, acs)); }
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); }
//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; }
//===================================================================== /// <summary> /// Constructor /// </summary> public AutoCompleteTextBoxCell() { source = AutoCompleteSource.None; }
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; }
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); } }
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); }
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); }
/// <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; }