System.Windows.Forms.ComboBox.FindStringExact(string)

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

15 Examples 7

1. Example

Project: Krypton
Source File: KryptonComboBox.cs
View license
public int FindStringExact(string str)
        {
            return _comboBox.FindStringExact(str);
        }

2. Example

View license
[Test]
        public void TestComplexEntry()
        {
            dlg.Show();
            TextBox config = TextBoxes["configurationNameTextBox"];
            Button okButton = Buttons["okButton"];
            ComboBox combo = Combos["configurationComboBox"];

            config.Text = "Super";
            combo.SelectedIndex = combo.FindStringExact("Release");

            okButton.PerformClick();
            Assert.AreEqual("Super", dlg.ConfigToCreate);
            Assert.AreEqual("Release", dlg.ConfigToCopy);
        }

3. Example

Project: poderosa
Source File: FontDialog.cs
View license
public void SetFont(bool cleartype, bool enable_bold, bool force_bold, Font ascii, Font cjk) {
            _ignoreEvent = true;
            _asciiFont = ascii;
            if (force_bold)
                _asciiFont = new Font(_asciiFont, _asciiFont.Style | FontStyle.Bold);
            _cjkFont = cjk;
            if (force_bold)
                _cjkFont = new Font(_cjkFont, _cjkFont.Style | FontStyle.Bold);
            _checkClearType.Checked = cleartype;
            _checkBoldStyle.Checked = enable_bold;
            _checkForceBoldStyle.Checked = force_bold;
            _lASCIISample.ClearType = cleartype;
            _lCJKSample.ClearType = cleartype;
            int s = (int)ascii.Size;
            _fontSizeList.SelectedIndex = _fontSizeList.FindStringExact(s.ToString());
            _asciiFontList.SelectedIndex = _asciiFontList.FindStringExact(ascii.Name);
            _cjkFontList.SelectedIndex = _cjkFontList.FindStringExact(cjk.Name);

            if (_asciiFontList.SelectedIndex == -1)
                _asciiFontList.SelectedIndex = _asciiFontList.FindStringExact("Courier New");
            if (_cjkFontList.SelectedIndex == -1)
                _cjkFontList.SelectedIndex = _cjkFontList.FindStringExact("?? ????");

            _lASCIISample.Font = ascii;
            _lCJKSample.Font = cjk;
            _ignoreEvent = false;
        }

4. Example

View license
[Test]
        public void TestComplexEntry()
        {
            dlg.Show();
            TextBox config = TextBoxes["configurationNameTextBox"];
            Button okButton = Buttons["okButton"];
            ComboBox combo = Combos["configurationComboBox"];

            config.Text = "Super";
            combo.SelectedIndex = combo.FindStringExact("Release");

            okButton.PerformClick();
            Assert.AreEqual("Super", dlg.ConfigToCreate);
            Assert.AreEqual("Release", dlg.ConfigToCopy);
        }

5. Example

Project: ClearCanvas
Source File: SuggestComboBox.cs
View license
private void UpdateSelectionFromText()
		{
			try
			{
				// do a case-insensitive search
				var itemIndex = this.FindStringExact(this.Text);
				if (itemIndex > -1)
				{
					// update the selected index
					this.SelectedIndex = itemIndex;

					// also update the visible text, because the upper/lower-casing may not match
					var item = this.Items[itemIndex];
					this.Text = GetItemText(item);
				}
				else
				{
					// doesn't match any suggestions, clear the text
					this.Text = null;
				}
			}
			catch (ArgumentOutOfRangeException)
			{
				// if the combo box is dropped down, and the control loses focus (calling OnLeave),
				// it seems WinForms throws an exception from this.Text
				// not sure why this happens, but there is really nothing that can be done in terms of recovery
			}

			// there are 2 ways that the value can change
			// either the selection change is comitted, or the control loses focus
			OnValueChanged(EventArgs.Empty);
		}

6. Example

View license
[Test]
		public void TestComplexEntry()
		{
			dlg.Show();
			TextBox config = TextBoxes["configurationNameTextBox"];
			Button okButton = Buttons["okButton"];
			ComboBox combo = Combos["configurationComboBox"];

			config.Text = "Super";
			combo.SelectedIndex = combo.FindStringExact( "<none>" );

			okButton.PerformClick();
			Assert.AreEqual( "Super", dlg.ConfigurationName );
			Assert.IsNull( dlg.CopyConfigurationName );
		}

7. Example

View license
[Test]
		public void TestComplexEntry()
		{
			dlg.Show();
			TextBox config = TextBoxes["configurationNameTextBox"];
			Button okButton = Buttons["okButton"];
			ComboBox combo = Combos["configurationComboBox"];

			config.Text = "Super";
			combo.SelectedIndex = combo.FindStringExact( "<none>" );

			okButton.PerformClick();
			Assert.AreEqual( "Super", dlg.ConfigurationName );
			Assert.IsNull( dlg.CopyConfigurationName );
		}

8. Example

View license
[Test]
		public void TestComplexEntry()
		{
			dlg.Show();
			TextBox config = TextBoxes["configurationNameTextBox"];
			Button okButton = Buttons["okButton"];
			ComboBox combo = Combos["configurationComboBox"];

			config.Text = "Super";
			combo.SelectedIndex = combo.FindStringExact( "<none>" );

			okButton.PerformClick();
			Assert.AreEqual( "Super", dlg.ConfigurationName );
			Assert.IsNull( dlg.CopyConfigurationName );
		}

9. Example

View license
[Test]
		public void TestComplexEntry()
		{
			dlg.Show();
			TextBox config = TextBoxes["configurationNameTextBox"];
			Button okButton = Buttons["okButton"];
			ComboBox combo = Combos["configurationComboBox"];

			config.Text = "Super";
			combo.SelectedIndex = combo.FindStringExact( "<none>" );

			okButton.PerformClick();
			Assert.AreEqual( "Super", dlg.ConfigurationName );
			Assert.IsNull( dlg.CopyConfigurationName );
		}

10. Example

View license
[Test]
		public void TestComplexEntry()
		{
			dlg.Show();
			TextBox config = TextBoxes["configurationNameTextBox"];
			Button okButton = Buttons["okButton"];
			ComboBox combo = Combos["configurationComboBox"];

			config.Text = "Super";
			combo.SelectedIndex = combo.FindStringExact( "<none>" );

			okButton.PerformClick();
			Assert.AreEqual( "Super", dlg.ConfigurationName );
			Assert.IsNull( dlg.CopyConfigurationName );
		}

11. Example

View license
[Test]
		public void TestComplexEntry()
		{
			dlg.Show();
			TextBox config = TextBoxes["configurationNameTextBox"];
			Button okButton = Buttons["okButton"];
			ComboBox combo = Combos["configurationComboBox"];

			config.Text = "Super";
			combo.SelectedIndex = combo.FindStringExact( "<none>" );

			okButton.PerformClick();
			Assert.AreEqual( "Super", dlg.ConfigurationName );
			Assert.IsNull( dlg.CopyConfigurationName );
		}

12. Example

Project: poderosa
Source File: FontDialog.cs
View license
private bool CheckFixedSizeFont(string name, params float[] allowed_sizes) {
            if (_asciiFont.Name == name || _cjkFont.Name == name) {
                float sz = GetFontSize();
                bool contained = false;
                float diff = Single.MaxValue;
                float nearest = 0;
                foreach (float t in allowed_sizes) {
                    if (t == sz) {
                        contained = true;
                        break;
                    }
                    else {
                        if (diff > Math.Abs(sz - t)) {
                            diff = Math.Abs(sz - t);
                            nearest = t;
                        }
                    }
                }

                if (!contained) {
                    GUtil.Warning(this, String.Format(TerminalUIPlugin.Instance.Strings.GetString("Message.GFontDialog.NotTrueTypeWarning"), name, nearest));
                    _fontSizeList.SelectedIndex = _fontSizeList.FindStringExact(nearest.ToString());
                    return false;
                }
                else
                    return true;
            }
            else
                return true;
        }

13. Example

Project: poderosa
Source File: TelnetSSHLoginDialog.cs
View license
public void ApplyParam(IAdaptable destination, ITerminalSettings terminal) {
            _initializi/n ..... /n //View Source file for more details /n }

14. Example

View license
protected override void OnKeyPress(KeyPressEventArgs e)
        {
            int idx = -1;
        /n ..... /n //View Source file for more details /n }

15. Example

Project: MGE-XE
Source File: ResolutionForm.cs
View license
private void cmbRes_SelectedIndexChanged(object sender, EventArgs e) {
            string[] str = cmbRes.Text.Trim(new char[] { ' ', '*' }).Split('x');
            tbWidth.Text = str[0].Trim();
            tbHeight.Text = str[1].Trim();

            string previousRefresh = cmbRefreshRate.Text;
            cmbRefreshRate.Items.Clear();
            cmbRefreshRate.Items.Add(Statics.strings["Default"]);
            foreach (int i in DirectX.DXMain.GetRefreshRates(Convert.ToInt32(tbWidth.Text), Convert.ToInt32(tbHeight.Text)))
                cmbRefreshRate.Items.Add(i.ToString());
            
            cmbRefreshRate.SelectedIndex = cmbRefreshRate.FindStringExact(previousRefresh);
            if(cmbRefreshRate.SelectedIndex == -1) cmbRefreshRate.SelectedIndex = 0;
        }