public FormBusqueda(DataTable dtSource ,BindingSource bsSource) { InitializeComponent(); displayMembers = cboColumns.Items; this.dtSource = dtSource; this.bsSource = bsSource; }
private void FillFullCollection() { FullCollection = new ComboBox.ObjectCollection(this.ResCntrl); FullCollection.Add("800 x 600"); FullCollection.Add("1024 x 768"); FullCollection.Add("1152 x 864"); }
//methods that intialize and adds members to the two collections private void FillWideCollection() { WideCollection = new ComboBox.ObjectCollection(this.ResCntrl); WideCollection.Add("1024 x 576"); WideCollection.Add("1366 x 768"); WideCollection.Add("1600 x 900"); }
/// <summary> /// Constructor for Preview Table Dialog dialog /// </summary> /// <param name="frm">The main form</param> /// <param name="project">The current project</param> /// <param name="tableFields">Selected fields collection</param> /// <param name="tableName">The table name</param> public PreviewTableDialog(MainForm frm, Project project, ComboBox.ObjectCollection tableFields, string tableName) : base(frm) { InitializeComponent(); currentProject = project; currentTableName = tableName; fields = tableFields; columnCollection = new List<string>(); btnOK.Visible = false; lblInstruction.Text = "The grid below displays the fields from the selected table. Click Back to go to the Match Fields screen."; }
public ComboBox() { _items = new ObjectCollection(this); AutoCompleteMode = Forms.AutoCompleteMode.None; AutoCompleteSource = Forms.AutoCompleteSource.None; BackColor = Color.FromArgb(234, 234, 234); DropDownStyle = ComboBoxStyle.DropDownList; BorderColor = Color.DarkGray; BorderColorDisabled = Color.FromArgb(217, 217, 217); BorderColorHovered = Color.FromArgb(126, 180, 234); HoverColor = Color.FromArgb(221, 237, 252); Padding = new Forms.Padding(4, 0, 4, 0); Size = new Size(121, 22); }
public CreatTask(ScheduleForm form, ListView view) { InitializeComponent(); scheduleform = form; listView = view; int i = 1; ComboBox.ObjectCollection Macs = new ComboBox.ObjectCollection(Computers); Macs.Insert(0, ""); foreach(ListViewItem item in view.Items) { if (i != view.Items.Count) { Macs.Insert(i, item.SubItems[1].Text); i++; } } Computers.DataSource = Macs; }
public void IndexOfTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); col.Add ("Item2"); Assert.AreEqual (1, col.IndexOf ("Item2"), "#F1"); }
public void ContainsTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); object obj = "Item1"; col.Add (obj); Assert.AreEqual (true, col.Contains ("Item1"), "#E1"); Assert.AreEqual (false, col.Contains ("Item2"), "#E2"); }
public void ClearTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); col.Add ("Item2"); col.Clear (); Assert.AreEqual (0, col.Count, "#D1"); }
public void AddRange_Null () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); try { col.AddRange (null); Assert.Fail ("#1"); } catch (ArgumentNullException ex) { Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2"); Assert.IsNull (ex.InnerException, "#3"); Assert.IsNotNull (ex.Message, "#4"); Assert.IsNotNull (ex.ParamName, "#5"); Assert.AreEqual ("items", ex.ParamName, "#6"); } }
public void AddTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); col.Add ("Item2"); Assert.AreEqual (2, col.Count, "#C1"); }
public void RemoveAtTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); col.Add ("Item2"); col.RemoveAt (0); Assert.AreEqual (1, col.Count, "#H1"); Assert.AreEqual (true, col.Contains ("Item2"), "#H1"); }
private void InitLabelArrays() { //Sixteen Fault Labels Faults[0] = Fault_0; Faults[1] = Fault_1; Faults[2] = Fault_2; Faults[3] = Fault_3; Faults[4] = Fault_4; Faults[5] = Fault_5; Faults[6] = Fault_6; Faults[7] = Fault_7; Faults[8] = Fault_8; Faults[9] = Fault_9; Faults[10] = Fault_10; Faults[11] = Fault_11; Faults[12] = Fault_12; Faults[13] = Fault_13; Faults[14] = Fault_14; Faults[15] = Fault_15; //Eight Discrete IO Labels DiscreteIO[0] = Discrete_0; DiscreteIO[1] = Discrete_1; DiscreteIO[2] = Discrete_2; DiscreteIO[3] = Discrete_3; DiscreteIO[4] = Discrete_4; DiscreteIO[5] = Discrete_5; DiscreteIO[6] = Discrete_6; DiscreteIO[7] = Discrete_7; //Update MDA String list MOOG_MDAOPTIONSTRINGS = MDAFileBox.Items; }
private void cmbOperator_SelectedIndexChanged(object sender, EventArgs e) { ComboBox.ObjectCollection rows = new ComboBox.ObjectCollection(cmbMobileNumberPrefix); rows.Clear(); if (cmbOperator.SelectedItem.ToString() == "Bakcell") { //bakcell de prefix yalniz bir denedir rows.Add("55"); cmbMobileNumberPrefix.SelectedItem = "55"; } else { rows.Add("50"); rows.Add("51"); cmbMobileNumberPrefix.SelectedItem = "50"; } }
public ComboBox() { _items = new ObjectCollection(this); AutoCompleteMode = Forms.AutoCompleteMode.None; AutoCompleteSource = Forms.AutoCompleteSource.None; BackColor = Color.FromArgb(234, 234, 234); CanSelect = true; DropDownStyle = ComboBoxStyle.DropDownList; BorderColor = Color.DarkGray; BorderColorDisabled = Color.FromArgb(217, 217, 217); BorderColorHovered = Color.FromArgb(126, 180, 234); HoverColor = Color.FromArgb(221, 237, 252); Padding = new Forms.Padding(4, 0, 4, 0); Size = new Size(121, 22); }
public void IndexOf_Null () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); try { col.IndexOf (null); Assert.Fail ("#1"); } catch (ArgumentNullException ex) { Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2"); Assert.IsNull (ex.InnerException, "#3"); Assert.IsNotNull (ex.Message, "#4"); Assert.IsNotNull (ex.ParamName, "#5"); #if NET_2_0 Assert.AreEqual ("value", ex.ParamName, "#6"); #endif } }
public void RemoveTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); col.Add ("Item2"); col.Remove ("Item1"); Assert.AreEqual (1, col.Count, "#1"); col.Remove (null); Assert.AreEqual (1, col.Count, "#2"); }
/// <summary> /// This is used to create an object collection with the appropriate writing system choices to be used in wsCombo. The reason it is cached is because /// list generation will require looping through each kind of combo box several times. /// /// This version is visible to InterlinDocRootSiteBase for its context menu. /// </summary> /// <param name="cachedBoxes"></param> /// <param name="comboContent"></param> /// <param name="cache"></param> /// <param name="owner"></param> /// <returns></returns> internal static ComboBox.ObjectCollection WsComboItemsInternal(FdoCache cache, ComboBox owner, Dictionary<ColumnConfigureDialog.WsComboContent, ComboBox.ObjectCollection> cachedBoxes, ColumnConfigureDialog.WsComboContent comboContent) { ComboBox.ObjectCollection objectCollection; if (!cachedBoxes.ContainsKey(comboContent)) { objectCollection = new ComboBox.ObjectCollection(owner); // The final argument here restricts writing systems that will be added to the combo box to // only be "real" writing systems. So, English will be added, but not "Default Analysis". // This functionality should eventually go away. See LT-4740. // JohnT: it now partially has, two lines support 'best analysis'. ColumnConfigureDialog.AddWritingSystemsToCombo(cache, objectCollection, comboContent, comboContent != ColumnConfigureDialog.WsComboContent.kwccBestAnalysis); cachedBoxes[comboContent] = objectCollection; } else { objectCollection = cachedBoxes[comboContent]; } return objectCollection; }
public void Indexer_Null () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); col.Add ("Item1"); try { col [0] = null; Assert.Fail ("#1"); } catch (ArgumentNullException ex) { Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2"); Assert.IsNull (ex.InnerException, "#3"); Assert.IsNotNull (ex.Message, "#4"); Assert.IsNotNull (ex.ParamName, "#5"); Assert.AreEqual ("value", ex.ParamName, "#6"); } }
public void ComboBoxObjectCollectionPropertyTest () { ComboBox.ObjectCollection col = new ComboBox.ObjectCollection (new ComboBox ()); Assert.AreEqual (false, col.IsReadOnly, "#B1"); Assert.AreEqual (false, ((ICollection)col).IsSynchronized, "#B2"); Assert.AreEqual (col, ((ICollection)col).SyncRoot, "#B3"); Assert.AreEqual (false, ((IList)col).IsFixedSize, "#B4"); }