System.Windows.Forms.ComboBox.ObjectCollection.Clear()

Here are the examples of the csharp api class System.Windows.Forms.ComboBox.ObjectCollection.Clear() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

1. Example

Project: KeeAnywhere
Source File: ImageComboBox.cs
View license
public void ComboBoxClear()
		{
			base.Items.Clear();
		}

2. Example

Project: My-FyiReporting
Source File: PropertyCtl.cs
View license
internal void Reset()
        {
            _Draw = null;
            _DesignCtl = null;
            this.pgSelected.SelectedObject = null;
            cbReportItems.Items.Clear();
            _NameCollection = null;
        }

3. Example

Project: LaserGRBL
Source File: ComboBoxEnumItem.cs
View license
public void Clear()
		{Items.Clear(); }

4. Example

View license
private void FillComboBox()
		{
			tabSelectComboBox.Items.Clear();

			foreach( TextDisplayTabSettings.TabInfo tabInfo in this.tabSettings.Tabs )
				this.tabSelectComboBox.Items.Add( tabInfo.Title );

			tabSelectComboBox.Items.Add( "<New...>" );
			tabSelectComboBox.Items.Add( "<Edit...>" );
		}

5. Example

Project: ContinuousTests
Source File: ProjectEditor.cs
View license
private void configComboBox_Populate()
		{
			configComboBox.Items.Clear();

			if ( selectedConfig == null )
				selectedConfig = project.ActiveConfig;

			int selectedIndex = -1; 
			foreach( ProjectConfig config in project.Configs )
			{
				string name = config.Name;
				int index = configComboBox.Items.Add( name );
				if ( name == selectedConfig.Name )
					selectedIndex = index;
			}

			if ( selectedIndex == -1 && configComboBox.Items.Count > 0 )
			{
				selectedIndex = 0;
				selectedConfig = project.Configs[0];
			}

			if ( selectedIndex == -1 )
				selectedConfig = null;
			else
				configComboBox.SelectedIndex = selectedIndex;
		
			addAssemblyButton.Enabled = removeAssemblyButton.Enabled = project.Configs.Count > 0;
		}

6. Example

Project: ContinuousTests
Source File: ProjectEditor.cs
View license
private void populateDomainUsageComboBox()
        {
            domainUsageComboBox.Items.Clear();
            domainUsageComboBox.Items.Add("Default");
            //domainUsageComboBox.Items.Add("None");
            domainUsageComboBox.Items.Add("Single");
            if (project.ProcessModel != ProcessModel.Multiple)
                domainUsageComboBox.Items.Add("Multiple");

            domainUsageComboBox.SelectedIndex = 0;
        }

7. Example

View license
private void FillTabSelectComboBox()
		{
			tabSelectComboBox.Items.Clear();

			foreach( TextDisplayTabSettings.TabInfo tabInfo in this.tabSettings.Tabs )
				this.tabSelectComboBox.Items.Add( tabInfo.Title );

			tabSelectComboBox.Items.Add( "<New...>" );
			tabSelectComboBox.Items.Add( "<Edit...>" );
		}

8. Example

Project: ContinuousTests
Source File: PropertyView.cs
View license
private void SetComboBoxOptions(ComboBox comboBox, string[] options)
        {
            comboBox.Items.Clear();

            foreach (object opt in options)
                comboBox.Items.Add(opt);

            if (comboBox.Items.Count > 0)
                comboBox.SelectedIndex = 0;
        }

9. Example

View license
private void FillComboBox()
		{
			tabSelectComboBox.Items.Clear();

			foreach( TextDisplayTabSettings.TabInfo tabInfo in this.tabSettings.Tabs )
				this.tabSelectComboBox.Items.Add( tabInfo.Title );

			tabSelectComboBox.Items.Add( "<New...>" );
			tabSelectComboBox.Items.Add( "<Edit...>" );
		}

10. Example

Project: ContinuousTests
Source File: ProjectEditor.cs
View license
private void configComboBox_Populate()
		{
			configComboBox.Items.Clear();

			if ( selectedConfig == null )
				selectedConfig = project.ActiveConfig;

			int selectedIndex = -1; 
			foreach( ProjectConfig config in project.Configs )
			{
				string name = config.Name;
				int index = configComboBox.Items.Add( name );
				if ( name == selectedConfig.Name )
					selectedIndex = index;
			}

			if ( selectedIndex == -1 && configComboBox.Items.Count > 0 )
			{
				selectedIndex = 0;
				selectedConfig = project.Configs[0];
			}

			if ( selectedIndex == -1 )
				selectedConfig = null;
			else
				configComboBox.SelectedIndex = selectedIndex;
		
			addAssemblyButton.Enabled = removeAssemblyButton.Enabled = project.Configs.Count > 0;
		}

11. Example

Project: ContinuousTests
Source File: ProjectEditor.cs
View license
private void populateDomainUsageComboBox()
        {
            domainUsageComboBox.Items.Clear();
            domainUsageComboBox.Items.Add("Default");
            //domainUsageComboBox.Items.Add("None");
            domainUsageComboBox.Items.Add("Single");
            if (project.ProcessModel != ProcessModel.Multiple)
                domainUsageComboBox.Items.Add("Multiple");

            domainUsageComboBox.SelectedIndex = 0;
        }

12. Example

Project: dp2
Source File: DbNameMapItemDlg.cs
View license
private void DbNameMapItemDlg_Load(object sender, System.EventArgs e)
        {
            if (this.AskMode == AskMode.AskNullOrigin)
            {
                this.textBox_origin.Enabled = false;
                this.button_findOrigin.Enabled = false;
                this.button_directAllServerMap.Enabled = false;

                this.comboBox_writeMode.Items.Clear();
                this.comboBox_writeMode.Items.Add("append -- ??");
                this.comboBox_writeMode.Items.Add("skip -- ??");
            }
            else if (this.AskMode == AskMode.AskNotMatchOrigin)
            {
                this.textBox_origin.Enabled = false;
                this.button_findOrigin.Enabled = false;

                this.button_directAllServerMap.Enabled = true;
            }
        }

13. Example

Project: dp2
Source File: DbNameMapItemDlg.cs
View license
private void DbNameMapItemDlg_Load(object sender, System.EventArgs e)
		{
			if (this.AskMode == AskMode.AskNullOrigin)
			{
				this.textBox_origin.Enabled = false;
				this.button_findOrigin.Enabled = false;
				this.button_directMap.Enabled = false;

				this.comboBox_writeMode.Items.Clear();
				this.comboBox_writeMode.Items.Add("append -- ???");
				this.comboBox_writeMode.Items.Add("skip -- ????");
			}
			else if (this.AskMode == AskMode.AskNotMatchOrigin)
			{
				this.textBox_origin.Enabled = false;
				this.button_findOrigin.Enabled = false;

				this.button_directMap.Enabled = true;
			}
		}

14. Example

Project: DNTLive
Source File: CityForm.cs
View license
private void BindCityInfoById(ComboBox comboBox, int pid)
        {
            var list = ShopMenuHelper.GetCityInfoList<CityModel>(tempModel.ConnStr, pid);
            if (list == null) { return; }
            comboBox.Items.Clear();
            foreach (var item in list)
            {
                comboBox.Items.Add(item);
            }
        }

15. Example

Project: DllExport
Source File: Storage.cs
View license
private void Populate()
        {
            box.Items.Clear();
            foreach(var elem in storage) {
                box.Items.Add(elem.name);
            }
        }

16. Example

Project: Clausewitz-EU4-Editor
Source File: Main.cs
View license
void LoadCombobox(ComboBox cmb, List<string> items) //loads a list into combobox items
        {
            cmb.Items.Clear();
            foreach (string item in items)
            {
                cmb.Items.Add(item);
            }
        }

17. Example

Project: Clausewitz-EU4-Editor
Source File: SubEditor.cs
View license
void LoadCombobox(ComboBox cmb, List<string> items) //loads a list into combobox items
        {
            cmb.Items.Clear();
            foreach (string item in items)
            {
                cmb.Items.Add(item);
            }
        }

18. Example

Project: gong-shell
Source File: ShellComboBox.cs
View license
void CreateItems()
        {
            if (!m_CreatingItems)
            {
                try
                {
                    m_CreatingItems = true;
                    m_Combo.Items.Clear();
                    CreateItem(m_RootFolder, 0);
                }
                finally
                {
                    m_CreatingItems = false;
                }
            }
        }

19. Example

Project: gong-shell
Source File: ShellComboBox.cs
View license
void CreateItems()
        {
            if (!m_CreatingItems)
            {
                try
                {
                    m_CreatingItems = true;
                    m_Combo.Items.Clear();
                    CreateItem(m_RootFolder, 0);
                }
                finally
                {
                    m_CreatingItems = false;
                }
            }
        }

20. Example

Project: Irony
Source File: GrammarItemList.cs
View license
public void ShowIn(ComboBox combo) {
      combo.Items.Clear();
      foreach (GrammarItem item in this)
        combo.Items.Add(item); 
    }

21. Example

Project: Irony
Source File: GrammarItemList.cs
View license
public void ShowIn(ComboBox combo) {
      combo.Items.Clear();
      foreach (GrammarItem item in this)
        combo.Items.Add(item); 
    }

22. Example

Project: lphant
Source File: FormDownloads.cs
View license
private void m_UpdateCategoryLabels()
		{
			//if in listBox
			comboBoxCategories.Items.Clear();
			//fixed labels
			comboBoxCategories.Items.Add(eLePhantForm.Globalization["LBL_ALL"]);
			comboBoxCategories.Items.Add(eLePhantForm.Globalization["LBL_VIDEO"]);
			comboBoxCategories.Items.Add(eLePhantForm.Globalization["LBL_FILE"]);
			comboBoxCategories.Items.Add(eLePhantForm.Globalization["LBL_AUDIO"]);

			//category labels
			ArrayList categories=krnGateway.GetCategories();
	
			foreach (CCategory category in categories)
			{
				comboBoxCategories.Items.Add(category.Name);
			}

			comboBoxCategories.SelectedIndex=0;
			//end if
		}

23. Example

Project: lphant
Source File: FormSearch.cs
View license
private void m_Globalize()
		{
			checkBoxSearchAny.Text = eLePhantForm.Globalization["LBL_SEARCHANY"];
			buttonExtend.Text = eLePhantForm.Globalization["LBL_SEARCHEXTEND"];
			buttonSearch.Text = eLePhantForm.Globalization["LBL_SEARCHFILE"];
			labelAvailability.Text = eLePhantForm.Globalization["LBL_AVAILABILITY"] + " > ";
			labelSizeLower.Text = eLePhantForm.Globalization["LBL_SIZELOWER"] + " < ";
			labelSizeUpper.Text = eLePhantForm.Globalization["LBL_SIZEUPPER"] + " > ";
			labelExclude.Text=eLePhantForm.Globalization["LBL_EXCLUDE"]+":";
			
			comboBoxSearchType.Items.Clear();
			comboBoxSearchType.Items.AddRange(new object[] {   eLePhantForm.Globalization["LBL_ANY"],
															   eLePhantForm.Globalization["LBL_VIDEO"],
															   eLePhantForm.Globalization["LBL_PROGRAM"],
															   eLePhantForm.Globalization["LBL_AUDIO"],
															   eLePhantForm.Globalization["LBL_IMAGE"]});
			if (comboBoxSearchType.SelectedIndex==-1) comboBoxSearchType.SelectedIndex=0;
		}

24. Example

Project: PKHeX
Source File: SAV_HallOfFame7.cs
View license
private void Setup()
        {
            int ofs = SAV.HoF;

            CHK_Flag.Checked = (BitConverter.ToUInt16(SAV.Data, ofs) & 1) == 1;
            NUD_Count.Value = BitConverter.ToUInt16(SAV.Data, ofs + 2);

            var specList = GameInfo.SpeciesDataSource.Where(s => s.Value <= SAV.MaxSpeciesID).ToList();
            for (int i = 0; i < entries.Length; i++)
            {
                int o = ofs + 4 + i*2;
                var cb = entries[i];
                cb.Items.Clear();

                cb.DisplayMember = "Text";
                cb.ValueMember = "Value";
                cb.DataSource = new BindingSource(specList, null);

                cb.SelectedValue = (int)BitConverter.ToUInt16(SAV.Data, o);
            }
        }

25. Example

Project: LiveSplit
Source File: GrammarItemList.cs
View license
public void ShowIn(ComboBox combo) {
      combo.Items.Clear();
      foreach (GrammarItem item in this)
        combo.Items.Add(item); 
    }

26. Example

Project: My-FyiReporting
Source File: BackgroundCtl.cs
View license
private void bEmbedded_Click(object sender, System.EventArgs e)
        {
            DialogEmbeddedImages dlgEI = new DialogEmbeddedImages(this._Draw);
            dlgEI.StartPosition = FormStartPosition.CenterParent;
            try
            {
                DialogResult dr = dlgEI.ShowDialog();
                if (dr != DialogResult.OK)
                    return;

                // Populate the EmbeddedImage names
                cbValueEmbedded.Items.Clear();
                cbValueEmbedded.Items.AddRange(_Draw.ReportNames.EmbeddedImageNames);
            }
            finally
            {
                dlgEI.Dispose();
            }
        }

27. Example

Project: My-FyiReporting
Source File: ChartCtl - Copy.cs
View license
private void cbChartType_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			fChartType =/n ..... /n //View Source file for more details /n }

28. Example

Project: My-FyiReporting
Source File: ChartCtl.cs
View license
private void cbChartType_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			fChartType =/n ..... /n //View Source file for more details /n }

29. Example

Project: My-FyiReporting
Source File: DialogNewChart.cs
View license
private void cbChartData_Enter(object sender, System.EventArgs e)
        {
            ComboBox cb = sender as ComboBox;
            if (cb == null)
                return;
            cb.Items.Clear();
            foreach (string field in this.lbFields.Items)
            {
                if (this.lbChartCategories.Items.IndexOf(field) >= 0 ||
                    this.lbChartSeries.Items.IndexOf(field) >= 0)
                    continue;
                // Field selected in columns and rows
                cb.Items.Add(string.Format("=Sum(Fields!{0}.Value)", field));
            }
        }

30. Example

Project: My-FyiReporting
Source File: ImageCtl.cs
View license
private void bEmbedded_Click(object sender, System.EventArgs e)
		{
			DialogEmbeddedImages dlgEI = new DialogEmbeddedImages(this._Draw);
			dlgEI.StartPosition = FormStartPosition.CenterParent;
            try
            {
                DialogResult dr = dlgEI.ShowDialog();
                if (dr != DialogResult.OK)
                    return;
            }
            finally
            {
                dlgEI.Dispose();
            }
			// Populate the EmbeddedImage names
			cbValueEmbedded.Items.Clear();
			cbValueEmbedded.Items.AddRange(_Draw.ReportNames.EmbeddedImageNames);

		}

31. Example

View license
private void LoadDefaultCommands()
        {
            _cmbDefaultCommand.Items.Clear();
            foreach (CommandTreeNode commandNode in TreeList.TvList.Nodes)
            {
                _cmbDefaultCommand.Items.Add(commandNode.Name);
            }
        }

32. Example

View license
private void InitializePaperInformation()
        {
            PrinterSettings.PaperSizeCollection /n ..... /n //View Source file for more details /n }

33. Example

View license
private void PopulateItems(IEnumerable<ICredentialRecord> credentialRecords)
        {
            if (credentialRecords == null) return;
            Items.Clear();
            foreach (var credential in credentialRecords)
                Items.Add(credential);
        }

34. Example

Project: llilum
Source File: EnvironmentForm.cs
View license
internal void ApplyToComboBox( ComboBox comboBox )
            {
                ComboBox.ObjectColl/n ..... /n //View Source file for more details /n }

35. Example

Project: NetOffice
Source File: TrayMenu.cs
View license
internal void OnDropDownItem_ListItemsCleared(TrayMenuDropDownListItem item)
        {
            ToolStripComboBox targetStrip = Find(item) as ToolStripComboBox;
            if (null != targetStrip)
                targetStrip.Items.Clear();
        }

36. Example

Project: nHydrate
Source File: RelationshipDialog.cs
View license
private void LoadTables(ComboBox cboEntity)
		{
			cboEntity.Items.Clear();
			foreach (var entity in _model.Entities.OrderBy(x => x.Name))
			{
				cboEntity.Items.Add(entity.Name);
			}
		}

37. Example

Project: nHydrate
Source File: RelationshipDialog.cs
View license
private void LoadFields(string tableName, ComboBox cboField)
		{
			cboField.Items.Clear();
			var entity = _model.Entities.FirstOrDefault(x => x.Name == tableName);
			if (entity != null)
			{
				foreach (var field in entity.Fields)
				{
					cboField.Items.Add(field.Name);
				}
			}
			cboField.Enabled = (cboField.Items.Count > 0);
		}

38. Example

Project: nHydrate
Source File: RelationshipViewDialog.cs
View license
private void LoadTables(ComboBox cboEntity)
		{
			cboEntity.Items.Clear();
			foreach (var entity in _model.Entities.OrderBy(x => x.Name))
			{
				cboEntity.Items.Add(entity.Name);
			}
		}

39. Example

Project: nHydrate
Source File: RelationshipViewDialog.cs
View license
private void LoadFields(string tableName, ComboBox cboField)
		{
			cboField.Items.Clear();
			var entity = _model.Entities.FirstOrDefault(x => x.Name == tableName);
			if (entity != null)
			{
				foreach (var field in entity.Fields)
				{
					cboField.Items.Add(field.Name);
				}
			}
			cboField.Enabled = (cboField.Items.Count > 0);
		}

40. Example

Project: nHydrate
Source File: RelationshipViewDialog.cs
View license
private void LoadViewFields(string viewName, ComboBox cboField)
		{
			cboField.Items.Clear();
			var entity = _model.Views.FirstOrDefault(x => x.Name == viewName);
			if (entity != null)
			{
				foreach (var field in entity.Fields)
				{
					cboField.Items.Add(field.Name);
				}
			}
			cboField.Enabled = (cboField.Items.Count > 0);
		}

41. Example

View license
private void LoadFields(string tableName, ComboBox cboField)
		{
			cboField.Items.Clear();
			var table = ((ModelRoot)this.Relation.Root).Database.Tables[tableName];
			foreach (Reference reference in table.Columns)
			{
				cboField.Items.Add(((Column)reference.Object).Name);
			}
			cboField.Enabled = (cboField.Items.Count > 0);
		}

42. Example

View license
public void Initialize(object[] items, object initialValue, IDelayedFetchHandler fetchHandler)
        {
            Items.Clear();
            Items.AddRange(items);
            SelectedItem = initialValue;
            _fetchHandler = fetchHandler;
        }

43. Example

View license
private void LoadLinkTargetsCombo()
        {
            LinkTargetType targetType = HtmlImageTargetSettings.LinkTarget;
            this.comboBoxLinkTargets.Items.Clear();
            if (LinkToSourceImageEnabled)
                comboBoxLinkTargets.Items.Add(new OptionItem(Res.Get(StringId.LinkToSource), LinkTargetType.IMAGE));
            comboBoxLinkTargets.Items.Add(new OptionItem(Res.Get(StringId.LinkToURL), LinkTargetType.URL));
            comboBoxLinkTargets.Items.Add(new OptionItem(Res.Get(StringId.LinkToNone), LinkTargetType.NONE));

            comboBoxLinkTargets.SelectedItem = new OptionItem("", targetType);

            //comboBoxLinkTargets.Visible = comboBoxLinkTargets.Items.Count > 1;
        }

44. Example

View license
private void InitializeComboItems()
        {
            Items.Clear();
            if (!DesignMode)
            {
                Items.Add(new ImageSizeComboItem(ImageSize.Small, Res.Get(StringId.ImgSBSizerSmall), _scaledImageSizeDelegate));
                Items.Add(new ImageSizeComboItem(ImageSize.Medium, Res.Get(StringId.ImgSBSizerMedium), _scaledImageSizeDelegate));
                Items.Add(new ImageSizeComboItem(ImageSize.Large, Res.Get(StringId.ImgSBSizerLarge), _scaledImageSizeDelegate));
                Items.Add(new ImageSizeComboItem(ImageSize.Original, Res.Get(StringId.ImgSBSizerOriginal), _scaledImageSizeDelegate));
            }
        }

45. Example

View license
public void comboboxPopulate(ComboBox combobox)
        {
            // clear all items
            combobox.Items.Clear();

            // iterate through items
            foreach (OutputConfiguration oc in m_outputConfigurationList)
            {
                // get the name
                combobox.Items.Add(oc.displayName);
            }
        }

46. Example

View license
private void FillComboWithItems(ComboBox combo)
		{
			//Add all physical items, components, and ammo to the combo box
			combo.Items.Clear();
			foreach (var itemType in m_physicalItemsDefinitionsManager.Definitions)
			{
				combo.Items.Add(itemType.Id);
			}
			foreach (var itemType in m_componentsDefinitionsManager.Definitions)
			{
				combo.Items.Add(itemType.Id);
			}
			foreach (var itemType in m_ammoMagazinesDefinitionsManager.Definitions)
			{
				combo.Items.Add(itemType.Id);
			}
		}

47. Example

Project: SLED
Source File: SledTargetService.cs
View license
private void UpdateRemoteTargetComboBox()
        {
            try
            {
                // Add all targets to combo box
                m_remoteTargetComboBox.Items.Clear();
                foreach (var target in m_lstTargets)
                    m_remoteTargetComboBox.Items.Add(target);

                // Select the proper target
                var selTarget = SelectedTarget;
                if (selTarget != null)
                    m_remoteTargetComboBox.SelectedItem = selTarget;
                else if (m_remoteTargetComboBox.Items.Count > 0)
                    m_remoteTargetComboBox.SelectedItem = m_remoteTargetComboBox.Items[0];
                else
                    m_remoteTargetComboBox.Text = string.Empty;
            }
            catch (Exception ex)
            {
                SledOutDevice.OutLine(
                    SledMessageType.Error,
                    SledUtil.TransSub(Localization.SledRemoteTargetErrorUpdatingComboBox, ex.Message));
            }
        }

48. Example

Project: SLED
Source File: SledLuaFunctionToolbar.cs
View license
private void ProjectServiceFileRemoving(object sender, SledProjectServiceFileEventArgs e)
        {
            if (e.File.SledDocument != m_sd)
                return;

            m_bChangingSelection = true;
            Items.Clear();
            Items.Add(NotProjectFile);
            SelectedItem = NotProjectFile;
            Enabled = false;
            m_bChangingSelection = false;
        }

49. Example

Project: Gorgon
Source File: ComboFonts.cs
View license
public void RefreshFonts()
		{
			Items.Clear();
		    foreach (var font in FontFamily.Families)
		    {
		        Items.Add(font.Name);
		    }
		}

50. Example

View license
public void Initialize(MethodDefinition mdef)
		{
			Items.Clear();
			if (mdef.HasBody)
			{
				foreach (T refItem in m_referenceditems)
				{
					W item = new W();
					item.Item = refItem;
					item.MethodDefinition = mdef;
					Items.Add(item);
				}
			}
		}