465 references to ComboBoxStyle
Accessibility_Core_App (1)
CommonControl1.Designer.cs (1)
318this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
PresentationUI (1)
MS\Internal\Documents\RMPublishingDialog.Designer.cs (1)
177this.comboBoxTemplates.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
System.Windows.Forms (62)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxAccessibleObject.cs (7)
43? owner.DropDownStyle != ComboBoxStyle.Simple 101if (!owner.IsHandleCreated || owner.DropDownStyle == ComboBoxStyle.Simple) 227ComboBoxStyle.DropDown => owner.ChildEditAccessibleObject, 228ComboBoxStyle.DropDownList => owner.ChildTextAccessibleObject, 229ComboBoxStyle.Simple => null, 235this.TryGetOwnerAs(out ComboBox? owner) && owner.DropDownStyle == ComboBoxStyle.Simple 241if (!this.IsOwnerHandleCreated(out ComboBox? owner) || owner.DropDownStyle == ComboBoxStyle.Simple)
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildDropDownButtonUiaProvider.cs (1)
63_owner.DropDownStyle == ComboBoxStyle.DropDownList
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildEditUiaProvider.cs (1)
56=> _owningComboBox.DropDownStyle != ComboBoxStyle.Simple
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildListUiaProvider.cs (2)
86return _owningComboBox.DropDownStyle == ComboBoxStyle.DropDownList 91return _owningComboBox.DropDownStyle == ComboBoxStyle.Simple
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (45)
147if (DropDownStyle == ComboBoxStyle.DropDownList 189if (DropDownStyle == ComboBoxStyle.DropDownList 309new ComboBoxChildListUiaProvider(this, DropDownStyle == ComboBoxStyle.Simple ? _childListBox!.HWND : _dropDownHandle); 344case ComboBoxStyle.Simple: 347case ComboBoxStyle.DropDown: 352case ComboBoxStyle.DropDownList: 789if (DropDownStyle == ComboBoxStyle.Simple) 947get => DropDownStyle == ComboBoxStyle.DropDownList ? string.Empty : Text.Substring(SelectionStart, SelectionLength); 950if (DropDownStyle != ComboBoxStyle.DropDownList) 1038[DefaultValue(ComboBoxStyle.DropDown)] 1041public ComboBoxStyle DropDownStyle 1043get => Properties.GetValueOrDefault(s_propStyle, ComboBoxStyle.DropDown); 1053if (value == ComboBoxStyle.DropDownList 1063Properties.AddOrRemoveValue(s_propStyle, value, defaultValue: ComboBoxStyle.DropDown); 1105if (DropDownStyle == ComboBoxStyle.DropDownList && !IsHandleCreated && !string.IsNullOrEmpty(value) && FindStringExact(value) == -1) 1204return ((_autoCompleteMode != AutoCompleteMode.None) && (DropDownStyle != ComboBoxStyle.DropDownList)); 1393if (DropDownStyle == ComboBoxStyle.Simple && m.HWnd == _childListBox!.Handle) 1412if (DropDownStyle == ComboBoxStyle.Simple && m.HWnd == _childListBox!.Handle) 1452if (DropDownStyle == ComboBoxStyle.Simple && m.HWnd == _childListBox!.Handle) 1477if (DropDownStyle == ComboBoxStyle.Simple && m.HWnd == _childListBox!.Handle) 1926if (DropDownStyle is ComboBoxStyle.DropDown 1927or ComboBoxStyle.DropDownList) 1974return DropDownStyle == ComboBoxStyle.Simple ? new(_childListBox) : new(this, _dropDownHandle); 1979return DropDownStyle == ComboBoxStyle.Simple ? _childListBox! : _childDropDown!; 2169if (DropDownStyle != ComboBoxStyle.DropDownList) 2231if (DropDownStyle == ComboBoxStyle.DropDownList && SelectedIndex == index) 2281if (ok && DropDownStyle != ComboBoxStyle.DropDownList) 2287if (DropDownStyle == ComboBoxStyle.Simple) 2318if (DropDownStyle == ComboBoxStyle.Simple) 2594&& (DropDownStyle == ComboBoxStyle.DropDownList || DropDownStyle == ComboBoxStyle.DropDown)) 2662if (DropDownStyle == ComboBoxStyle.Simple) 2742&& DropDownStyle == ComboBoxStyle.DropDownList) 2801if (DropDownStyle == ComboBoxStyle.Simple && recreate) 2821if (DropDownStyle == ComboBoxStyle.Simple && IsHandleCreated) 2880if (DropDownStyle == ComboBoxStyle.DropDown) 2887if (DropDownStyle == ComboBoxStyle.DropDownList) 2937if (DropDownStyle != ComboBoxStyle.DropDownList 2963&& DropDownStyle == ComboBoxStyle.DropDownList 3169if (DropDownStyle == ComboBoxStyle.DropDownList) 3172Debug.Assert(DropDownStyle == ComboBoxStyle.DropDownList); 3260if ((specified & BoundsSpecified.Height) != BoundsSpecified.None && DropDownStyle == ComboBoxStyle.Simple) 3438if (DropDownStyle == ComboBoxStyle.DropDown) 3449if ((DropDownStyle == ComboBoxStyle.Simple) && ParentInternal is not null) 3661&& DropDownStyle == ComboBoxStyle.DropDownList
System\Windows\Forms\Controls\ComboBox\ComboBox.FlatComboAdapter.cs (2)
69if (comboBox.DropDownStyle == ComboBoxStyle.Simple) 114if (comboBox.DropDownStyle == ComboBoxStyle.Simple)
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (1)
1278comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxEditingControl.DataGridViewComboBoxEditingControlAccessibleObject.cs (1)
57=> owner.DropDownStyle != ComboBoxStyle.Simple,
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.cs (2)
155[DefaultValue(ComboBoxStyle.DropDown)] 158public ComboBoxStyle DropDownStyle
System.Windows.Forms.Design (7)
System\Windows\Forms\Design\ComboBoxDesigner.cs (4)
109ComboBoxStyle style = ComboBoxStyle.Simple; 114if (style is ComboBoxStyle.DropDown or ComboBoxStyle.DropDownList)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (1)
434_columnTypesCombo.DropDownStyle = ComboBoxStyle.DropDownList;
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (1)
194_keyComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
System\Windows\Forms\Design\StyleEditorForm.cs (1)
294_columnsOrRowsComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
System.Windows.Forms.Interop.Tests (1)
AccessibleObjectTests.cs (1)
446DropDownStyle = ComboBoxStyle.DropDown
System.Windows.Forms.Tests (381)
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxAccessibleObjectTests.cs (35)
30[InlineData(ComboBoxStyle.DropDown)] 31[InlineData(ComboBoxStyle.DropDownList)] 32public void ComboBoxAccessibleObject_ExpandCollapse_Set_CollapsedState_IfControlIsCreated(ComboBoxStyle comboBoxStyle) 53[InlineData(ComboBoxStyle.DropDown)] 54[InlineData(ComboBoxStyle.DropDownList)] 55public void ComboBoxAccessibleObject_ExpandCollapse_Set_CollapsedState_IfControlIsNotCreated(ComboBoxStyle comboBoxStyle) 78[InlineData(ComboBoxStyle.DropDown)] 79[InlineData(ComboBoxStyle.DropDownList)] 80[InlineData(ComboBoxStyle.Simple)] 81public void ComboBoxAccessibleObject_FragmentNavigate_FirstChild_ReturnNull_IfHandleNotCreated(ComboBoxStyle comboBoxStyle) 126foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 132bool childListDisplayed = droppedDown || comboBoxStyle == ComboBoxStyle.Simple; 142ComboBoxStyle comboBoxStyle, 167foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 181public void ComboBoxAccessibleObject_FragmentNavigate_LastChild_ReturnsExpected(ComboBoxStyle comboBoxStyle, bool createControl, bool droppedDown) 195AccessibleObject expectedLastChild = comboBoxStyle == ComboBoxStyle.Simple 205[InlineData(ComboBoxStyle.DropDown)] 206[InlineData(ComboBoxStyle.DropDownList)] 207[InlineData(ComboBoxStyle.Simple)] 208public void ComboBoxAccessibleObject_FragmentNavigate_LastChild_ReturnNull_IfHandleNotCreated(ComboBoxStyle comboBoxStyle) 327using ComboBox comboBox = new() { DropDownStyle = ComboBoxStyle.Simple }; 336yield return new object[] { ComboBoxStyle.DropDown, false, SR.AccessibleActionExpand }; 337yield return new object[] { ComboBoxStyle.DropDown, true, SR.AccessibleActionCollapse }; 338yield return new object[] { ComboBoxStyle.DropDownList, false, SR.AccessibleActionExpand }; 339yield return new object[] { ComboBoxStyle.DropDownList, true, SR.AccessibleActionCollapse }; 344public void ComboBoxAccessibleObject_DefaultAction_IfHandleIsCreated_ReturnsExpected(ComboBoxStyle style, bool droppedDown, string expectedAction) 356public void ComboBoxAccessibleObject_GetPropertyValue_IfHandleIsCreated_ReturnsExpected(ComboBoxStyle style, bool droppedDown, string expectedAction) 382using ComboBox comboBox = new() { DropDownStyle = ComboBoxStyle.Simple }; 394[InlineData(ComboBoxStyle.DropDown, false, true)] 395[InlineData(ComboBoxStyle.DropDown, true, false)] 396[InlineData(ComboBoxStyle.DropDownList, false, true)] 397[InlineData(ComboBoxStyle.DropDownList, true, false)] 398public void ComboBoxAccessibleObject_DoDefaultAction_IfHandleIsCreated_DoesExpected(ComboBoxStyle style, bool droppedDown, bool expectedDroppedDown)
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (62)
82[InlineData(ComboBoxStyle.DropDown)] 83[InlineData(ComboBoxStyle.DropDownList)] 84[InlineData(ComboBoxStyle.Simple)] 85public void ComboBoxItemAccessibleObject_SeveralSameItems_FragmentNavigate_NextSibling_ReturnExpected(ComboBoxStyle comboBoxStyle) 121[InlineData(ComboBoxStyle.DropDown)] 122[InlineData(ComboBoxStyle.DropDownList)] 123[InlineData(ComboBoxStyle.Simple)] 124public void ComboBoxItemAccessibleObject_SeveralSameItems_FragmentNavigate_PreviousSibling_ReturnExpected(ComboBoxStyle comboBoxStyle) 166[InlineData(ComboBoxStyle.DropDown)] 167[InlineData(ComboBoxStyle.DropDownList)] 168[InlineData(ComboBoxStyle.Simple)] 169public void ComboBoxItemAccessibleObject_FragmentNavigate_Parent_ReturnListAccessibleObject(ComboBoxStyle comboBoxStyle) 179[InlineData(ComboBoxStyle.DropDown)] 180[InlineData(ComboBoxStyle.DropDownList)] 181[InlineData(ComboBoxStyle.Simple)] 182public void ComboBoxItemAccessibleObject_FragmentNavigate_Child_ReturnNull(ComboBoxStyle comboBoxStyle) 234foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 242public void ComboBoxItemAccessibleObject_ScrollIntoView_DoNothing_IfControlIsNotEnabled(ComboBoxStyle comboBoxStyle) 251if (comboBoxStyle == ComboBoxStyle.Simple) 277foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 291public void ComboBoxItemAccessibleObject_ScrollIntoView_EnsureVisible(ComboBoxStyle comboBoxStyle, bool scrollingDown, int itemIndex, int itemsCount) 303if (comboBoxStyle == ComboBoxStyle.Simple) 365foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 371int initialYPosition = comboBoxStyle == ComboBoxStyle.Simple ? 56 : 55; 372int x = comboBoxStyle == ComboBoxStyle.Simple ? 10 : 9; 382public void ComboBoxItemAccessibleObject_Bounds_ReturnsCorrect_IfComboBoxIsScrollable(ComboBoxStyle comboBoxStyle, int itemIndex, Point expectedPosition) 390if (comboBoxStyle == ComboBoxStyle.Simple) 410int itemWidth = comboBoxStyle == ComboBoxStyle.Simple ? 79 : 81; 420foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 429int width = comboBoxStyle == ComboBoxStyle.Simple ? 96 : 81; 430int x = comboBoxStyle == ComboBoxStyle.Simple ? 10 : 9; 431int y = comboBoxStyle == ComboBoxStyle.Simple ? 57 : 56; 445public void ComboBoxItemAccessibleObject_Bounds_ReturnsCorrect_ForDifferentHeightItems(ComboBoxStyle comboBoxStyle, int itemIndex, Rectangle expectedRect) 452if (comboBoxStyle == ComboBoxStyle.Simple) 508[InlineData(ComboBoxStyle.DropDownList)] 509[InlineData(ComboBoxStyle.DropDown)] 510public void ComboBoxItemAccessibleObject_MaxDropDownItems_State_ReturnExpected(ComboBoxStyle comboBoxStyle) 527[InlineData(ComboBoxStyle.DropDownList)] 528[InlineData(ComboBoxStyle.DropDown)] 529public void ComboBoxItemAccessibleObject_DropDownHeight_State_ReturnExpected(ComboBoxStyle comboBoxStyle) 546[InlineData(ComboBoxStyle.DropDownList)] 547[InlineData(ComboBoxStyle.DropDown)] 548public void ComboBoxItemAccessibleObject_DropDownCollapsed_State_ReturnExpected(ComboBoxStyle comboBoxStyle) 564using ComboBox comboBox = GetComboBoxWithMaxSize(ComboBoxStyle.Simple); 581[InlineData(ComboBoxStyle.DropDownList)] 582[InlineData(ComboBoxStyle.DropDown)] 583public void ComboBoxItemAccessibleObject_MaxDropDownItems_GetOffScreenProperty_ReturnExpected(ComboBoxStyle comboBoxStyle) 600[InlineData(ComboBoxStyle.DropDownList)] 601[InlineData(ComboBoxStyle.DropDown)] 602public void ComboBoxItemAccessibleObject_DropDownHeight_GetOffScreenProperty_ReturnExpected(ComboBoxStyle comboBoxStyle) 619[InlineData(ComboBoxStyle.DropDownList)] 620[InlineData(ComboBoxStyle.DropDown)] 621public void ComboBoxItemAccessibleObject_DropDownCollapsed_GetOffScreenProperty_ReturnExpected(ComboBoxStyle comboBoxStyle) 637using ComboBox comboBox = GetComboBoxWithMaxSize(ComboBoxStyle.Simple); 651private ComboBox GetComboBox(ComboBoxStyle comboBoxStyle) 665private ComboBox GetComboBoxWithMaxItems(ComboBoxStyle comboBoxStyle) 675private ComboBox GetComboBoxWithMaxHeight(ComboBoxStyle comboBoxStyle) 684private ComboBox GetComboBoxWithMaxSize(ComboBoxStyle comboBoxStyle)
System\Windows\Forms\Application.ParkingWindowTests.cs (2)
42DropDownStyle = ComboBoxStyle.DropDown 52comboBox.DropDownStyle = ComboBoxStyle.DropDownList;
System\Windows\Forms\ComboBox.ComboBoxChildDropDownButtonUiaProviderTests.cs (13)
12foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 15if (comboBoxStyle == ComboBoxStyle.Simple) 33ComboBoxStyle comboBoxStyle, 58ComboBoxStyle comboBoxStyle, 76AccessibleObject expectedItem = comboBoxStyle == ComboBoxStyle.DropDownList 85[InlineData(ComboBoxStyle.Simple)] 86[InlineData(ComboBoxStyle.DropDownList)] 87[InlineData(ComboBoxStyle.DropDown)] 89ComboBoxStyle comboBoxStyle) 104[InlineData(ComboBoxStyle.DropDownList)] 105[InlineData(ComboBoxStyle.DropDown)] 106public void DropDownButtonUiaProvider_Name_ReturnsExpected(ComboBoxStyle comboBoxStyle)
System\Windows\Forms\ComboBox.ComboBoxChildEditUiaProviderTests.cs (19)
13foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 16if (comboBoxStyle == ComboBoxStyle.DropDownList) 25bool childListDisplayed = droppedDown || comboBoxStyle == ComboBoxStyle.Simple; 35ComboBoxStyle comboBoxStyle, 61foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 64if (comboBoxStyle == ComboBoxStyle.DropDownList) 82ComboBoxStyle comboBoxStyle, 100AccessibleObject expectedItem = comboBoxStyle != ComboBoxStyle.Simple 109[InlineData(ComboBoxStyle.DropDown)] 110[InlineData(ComboBoxStyle.Simple)] 111public void ComboBoxChildEditUiaProvider_SupportsTextPattern(ComboBoxStyle comboBoxStyle) 125[InlineData(ComboBoxStyle.DropDown)] 126[InlineData(ComboBoxStyle.Simple)] 127public void ComboBoxChildEditUiaProvider_SupportsTextPattern2(ComboBoxStyle comboBoxStyle) 141[InlineData(ComboBoxStyle.DropDown)] 142[InlineData(ComboBoxStyle.Simple)] 143public void ComboBoxChildEditUiaProvider_SupportsValuePattern(ComboBoxStyle comboBoxStyle)
System\Windows\Forms\ComboBox.ComboBoxChildListUiaProviderTests.cs (10)
13foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 28ComboBoxStyle comboBoxStyle, 46AccessibleObject expectedItem = comboBoxStyle == ComboBoxStyle.Simple 57ComboBoxStyle comboBoxStyle, 75AccessibleObject expectedItem = comboBoxStyle == ComboBoxStyle.DropDownList 85foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 93public void ChildListAccessibleObject_BoundingRectangle_ReturnsCorrectWidth_IfComboBoxIsScrollable(ComboBoxStyle comboBoxStyle) 105if (comboBoxStyle == ComboBoxStyle.Simple)
System\Windows\Forms\ComboBox.ComboBoxChildNativeWindowTests.cs (1)
11using ComboBox comboBox = new() { DropDownStyle = ComboBoxStyle.DropDown };
System\Windows\Forms\ComboBox.ComboBoxChildTextUiaProviderTests.cs (2)
29DropDownStyle = ComboBoxStyle.DropDownList 54DropDownStyle = ComboBoxStyle.DropDownList
System\Windows\Forms\ComboBox.ComboBoxUiaTextProviderTests.cs (194)
14[InlineData(ComboBoxStyle.DropDown)] 15[InlineData(ComboBoxStyle.Simple)] 16public void ComboBoxUiaTextProvider_Ctor_DoesNotCreateControlHandle(ComboBoxStyle dropDownStyle) 39[InlineData(ComboBoxStyle.DropDown)] 40[InlineData(ComboBoxStyle.Simple)] 41public void ComboBoxUiaTextProvider_IsMultiline_IsFalse(ComboBoxStyle dropDownStyle) 55[InlineData(ComboBoxStyle.DropDown)] 56[InlineData(ComboBoxStyle.Simple)] 57public void ComboBoxUiaTextProvider_IsReadOnly_IsFalse(ComboBoxStyle dropDownStyle) 71[InlineData(ComboBoxStyle.DropDown)] 72[InlineData(ComboBoxStyle.Simple)] 73public void ComboBoxUiaTextProvider_IsScrollable_IsTrue(ComboBoxStyle dropDownStyle) 85[InlineData(ComboBoxStyle.DropDown)] 86[InlineData(ComboBoxStyle.Simple)] 87public void ComboBoxUiaTextProvider_IsScrollable_False_WithoutHandle(ComboBoxStyle dropDownStyle) 101[InlineData(ComboBoxStyle.DropDown)] 102[InlineData(ComboBoxStyle.Simple)] 103public void ComboBoxUiaTextProvider_GetWindowStyle_ReturnsNoneForNotInitializedControl(ComboBoxStyle dropDownStyle) 117[InlineData(ComboBoxStyle.DropDown, RightToLeft.Yes, true)] 118[InlineData(ComboBoxStyle.DropDown, RightToLeft.No, false)] 119[InlineData(ComboBoxStyle.Simple, RightToLeft.Yes, true)] 120[InlineData(ComboBoxStyle.Simple, RightToLeft.No, false)] 121public void ComboBoxUiaTextProvider_IsReadingRTL_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, RightToLeft rightToLeft, bool expectedResult) 133[InlineData(ComboBoxStyle.DropDown, RightToLeft.Yes)] 134[InlineData(ComboBoxStyle.DropDown, RightToLeft.No)] 135[InlineData(ComboBoxStyle.Simple, RightToLeft.Yes)] 136[InlineData(ComboBoxStyle.Simple, RightToLeft.No)] 137public void ComboBoxUiaTextProvider_IsReadingRTL_ReturnsFalse_WithoutHandle(ComboBoxStyle dropDownStyle, RightToLeft rightToLeft) 151[InlineData(ComboBoxStyle.DropDown)] 152[InlineData(ComboBoxStyle.Simple)] 153public void ComboBoxUiaTextProvider_DocumentRange_IsNotNull_WorksCorrectly(ComboBoxStyle dropDownStyle) 171[InlineData(ComboBoxStyle.DropDown)] 172[InlineData(ComboBoxStyle.Simple)] 173public void ComboBoxUiaTextProvider_DocumentRange_IsNull_ThrowException(ComboBoxStyle dropDownStyle) 184[InlineData(ComboBoxStyle.DropDown)] 185[InlineData(ComboBoxStyle.Simple)] 186public void ComboBoxUiaTextProvider_SupportedTextSelection_IsNotNull(ComboBoxStyle dropDownStyle) 201[InlineData(ComboBoxStyle.DropDown)] 202[InlineData(ComboBoxStyle.Simple)] 203public void ComboBoxUiaTextProvider_GetCaretRange_IsNotNull(ComboBoxStyle dropDownStyle) 219[InlineData(ComboBoxStyle.DropDown)] 220[InlineData(ComboBoxStyle.Simple)] 221public void ComboBoxUiaTextProvider_GetCaretRange_IsNull_IfHandleIsNotCreated(ComboBoxStyle dropDownStyle) 239[InlineData(ComboBoxStyle.DropDown)] 240[InlineData(ComboBoxStyle.Simple)] 241public void ComboBoxUiaTextProvider_LinesPerPage_ReturnsMinusOne_WithoutHandle(ComboBoxStyle dropDownStyle) 255[InlineData(ComboBoxStyle.DropDown)] 256[InlineData(ComboBoxStyle.Simple)] 257public void ComboBoxUiaTextProvider_LinesPerPage_ReturnsOne_WithHandle(ComboBoxStyle dropDownStyle) 269[InlineData(ComboBoxStyle.DropDown, 50, 20, 0)] 270[InlineData(ComboBoxStyle.DropDown, 50, 20, 50)] 271[InlineData(ComboBoxStyle.DropDown, 50, 20, 100)] 272[InlineData(ComboBoxStyle.DropDown, 50, 20, -5)] 273[InlineData(ComboBoxStyle.Simple, 50, 20, 0)] 274[InlineData(ComboBoxStyle.Simple, 50, 20, 50)] 275[InlineData(ComboBoxStyle.Simple, 50, 20, 100)] 276[InlineData(ComboBoxStyle.Simple, 50, 20, -5)] 278ComboBoxStyle dropDownStyle, 297[InlineData(ComboBoxStyle.DropDown, 50, 20, 5)] 298[InlineData(ComboBoxStyle.Simple, 50, 20, 5)] 300ComboBoxStyle dropDownStyle, 322foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 324if (comboBoxStyle == ComboBoxStyle.DropDownList) 340ComboBoxStyle dropDownStyle, 361ComboBoxStyle dropDownStyle, 382[InlineData(ComboBoxStyle.DropDown)] 383[InlineData(ComboBoxStyle.Simple)] 384public void ComboBoxUiaTextProvider_GetLogfont_ReturnsCorrectValue(ComboBoxStyle dropDownStyle) 402[InlineData(ComboBoxStyle.DropDown)] 403[InlineData(ComboBoxStyle.Simple)] 404public void ComboBoxUiaTextProvider_GetLogfont_ReturnsEmpty_WithoutHandle(ComboBoxStyle dropDownStyle) 423yield return new object[] { ComboBoxStyle.DropDown, new Size(50, 20), "Some test text for testing", 0, new Point(1, 0) }; 424yield return new object[] { ComboBoxStyle.DropDown, new Size(50, 20), "Some test text for testing", 15, new Point(79, 0) }; 426yield return new object[] { ComboBoxStyle.Simple, new Size(50, 20), "Some test text for testing", 0, new Point(1, 0) }; 427yield return new object[] { ComboBoxStyle.Simple, new Size(50, 20), "Some test text for testing", 15, new Point(79, 0) }; 432public void ComboBoxUiaTextProvider_GetPositionFromChar_ReturnsCorrectValue(ComboBoxStyle dropdownStyle, Size size, string text, int charIndex, Point expectedPoint) 450yield return new object[] { ComboBoxStyle.DropDown, new Size(50, 20), "Some test text for testing", 0 }; 451yield return new object[] { ComboBoxStyle.DropDown, new Size(50, 20), "Some test text for testing", 15 }; 453yield return new object[] { ComboBoxStyle.Simple, new Size(50, 20), "Some test text for testing", 0 }; 454yield return new object[] { ComboBoxStyle.Simple, new Size(50, 20), "Some test text for testing", 15 }; 459public void ComboBoxUiaTextProvider_GetPositionFromChar_ReturnsEmpty_WithoutHandle(ComboBoxStyle dropDownStyle, Size size, string text, int charIndex) 478foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 480if (comboBoxStyle == ComboBoxStyle.DropDownList) 498public void ComboBoxUiaTextProvider_GetPositionFromCharForUpperRightCorner_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, Size size, string text, int charIndex, Point expectedPoint) 516foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 518if (comboBoxStyle == ComboBoxStyle.DropDownList) 536public void ComboBoxUiaTextProvider_GetPositionFromCharForUpperRightCorner_ReturnsMinusOne_WithoutHandle(ComboBoxStyle dropDownStyle, Size size, string text, int charIndex) 555foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 557if (comboBoxStyle == ComboBoxStyle.DropDownList) 563int width = comboBoxStyle == ComboBoxStyle.DropDown ? 27 : 44; 565width = comboBoxStyle == ComboBoxStyle.DropDown ? 227 : 244; 572public void ComboBoxUiaTextProvider_GetFormattingRectangle_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, Size size, Rectangle expectedRectangle) 586[InlineData(ComboBoxStyle.DropDown)] 587[InlineData(ComboBoxStyle.Simple)] 588public void ComboBoxUiaTextProvider_GetFormattingRectangle_ReturnsEmpty_WithoutHandle(ComboBoxStyle dropDownStyle) 605foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 607if (comboBoxStyle == ComboBoxStyle.DropDownList) 621public void ComboBoxUiaTextProvider_Text_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, string text) 639public void ComboBoxUiaTextProvider_Text_ReturnsEmpty_WithoutHandle(ComboBoxStyle dropDownStyle, string text) 658public void ComboBoxUiaTextProvider_TextLength_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, string text) 673public void ComboBoxUiaTextProvider_TextLength_ReturnsMinusOne_WithoutHandle(ComboBoxStyle dropDownStyle, string text) 689[InlineData(ComboBoxStyle.DropDown)] 690[InlineData(ComboBoxStyle.Simple)] 691public void ComboBoxUiaTextProvider_WindowExStyle_ReturnsCorrectValue(ComboBoxStyle dropDownStyle) 703[InlineData(ComboBoxStyle.DropDown)] 704[InlineData(ComboBoxStyle.Simple)] 705public void ComboBoxUiaTextProvider_WindowExStyle_ReturnsLeft_WithoutHandle(ComboBoxStyle dropDownStyle) 721[InlineData(ComboBoxStyle.DropDown)] 722[InlineData(ComboBoxStyle.Simple)] 723public void ComboBoxUiaTextProvider_EditStyle_ReturnsCorrectValue(ComboBoxStyle dropDownStyle) 739[InlineData(ComboBoxStyle.DropDown)] 740[InlineData(ComboBoxStyle.Simple)] 741public void ComboBoxUiaTextProvider_EditStyle_ReturnsLeft_WithoutHandle(ComboBoxStyle dropDownStyle) 758foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 760if (comboBoxStyle == ComboBoxStyle.DropDownList) 767int expectedEnd = comboBoxStyle == ComboBoxStyle.DropDown ? 2 : 4; 769expectedEnd = comboBoxStyle == ComboBoxStyle.DropDown ? 4 : 8; 777public void ComboBoxUiaTextProvider_GetVisibleRangePoints_ForSinglelineComboBox_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, Size size, int expectedStart, int expectedEnd) 800foreach (ComboBoxStyle comboBoxStyle in Enum.GetValues(typeof(ComboBoxStyle))) 802if (comboBoxStyle == ComboBoxStyle.DropDownList) 817public void ComboBoxUiaTextProvider_GetVisibleRangePoints_ReturnsZeros_WithoutHandle(ComboBoxStyle dropDownStyle, Size size) 837yield return new object[] { ComboBoxStyle.DropDown, new Size(0, 0) }; 838yield return new object[] { ComboBoxStyle.DropDown, new Size(100, 20) }; 839yield return new object[] { ComboBoxStyle.Simple, new Size(0, 0) }; 840yield return new object[] { ComboBoxStyle.Simple, new Size(100, 20) }; 845public void ComboBoxUiaTextProvider_GetVisibleRanges_ReturnsCorrectValue(ComboBoxStyle dropDownStyle, Size size) 863public void ComboBoxUiaTextProvider_GetVisibleRanges_ReturnsNull_WithoutHandle(ComboBoxStyle dropDownStyle, Size size) 882[InlineData(ComboBoxStyle.DropDown)] 883[InlineData(ComboBoxStyle.Simple)] 884public void ComboBoxUiaTextProvider_RangeFromChild_DoesNotThrowAnException(ComboBoxStyle dropDownStyle) 902yield return new object[] { ComboBoxStyle.DropDown, Point.Empty }; 903yield return new object[] { ComboBoxStyle.DropDown, new Point(10, 10) }; 904yield return new object[] { ComboBoxStyle.Simple, Point.Empty }; 905yield return new object[] { ComboBoxStyle.Simple, new Point(10, 10) }; 910public void ComboBoxUiaTextProvider_RangeFromPoint_DoesNotThrowAnException(ComboBoxStyle dropDownStyle, Point point) 926public void ComboBoxUiaTextProvider_RangeFromPoint_ReturnsNull_WithoutHandle(ComboBoxStyle dropDownStyle, Point point) 943[InlineData(ComboBoxStyle.DropDown, 2, 5)] 944[InlineData(ComboBoxStyle.DropDown, 0, 10)] 945[InlineData(ComboBoxStyle.Simple, 2, 5)] 946[InlineData(ComboBoxStyle.Simple, 0, 10)] 947public void ComboBoxUiaTextProvider_SetSelection_GetSelection_ReturnCorrectValue(ComboBoxStyle dropDownStyle, int start, int end) 972[InlineData(ComboBoxStyle.DropDown, 2, 5)] 973[InlineData(ComboBoxStyle.DropDown, 0, 10)] 974[InlineData(ComboBoxStyle.Simple, 2, 5)] 975[InlineData(ComboBoxStyle.Simple, 0, 10)] 976public void ComboBoxUiaTextProvider_SetSelection_GetSelection_DontWork_WithoutHandle(ComboBoxStyle dropDownStyle, int start, int end) 1002[InlineData(ComboBoxStyle.DropDown, -5, 10)] 1003[InlineData(ComboBoxStyle.DropDown, 5, 100)] 1004[InlineData(ComboBoxStyle.Simple, -5, 10)] 1005[InlineData(ComboBoxStyle.Simple, 5, 100)] 1006public void ComboBoxUiaTextProvider_SetSelection_DoesNotSelectText_IfIncorrectArguments(ComboBoxStyle dropDownStyle, int start, int end) 1035[InlineData(ComboBoxStyle.DropDown, 0)] 1036[InlineData(ComboBoxStyle.DropDown, 2)] 1037[InlineData(ComboBoxStyle.Simple, 0)] 1038[InlineData(ComboBoxStyle.Simple, 2)] 1039public void ComboBoxUiaTextProvider_LineScroll_ReturnsFalse(ComboBoxStyle dropDownStyle, int newLine) 1054[InlineData(ComboBoxStyle.DropDown, 0)] 1055[InlineData(ComboBoxStyle.DropDown, 2)] 1056[InlineData(ComboBoxStyle.Simple, 0)] 1057[InlineData(ComboBoxStyle.Simple, 2)] 1058public void ComboBoxUiaTextProvider_LineScroll_DoesNotWork_WithoutHandle(ComboBoxStyle dropDownStyle, int newLine) 1075[InlineData(ComboBoxStyle.DropDown)] 1076[InlineData(ComboBoxStyle.Simple)] 1077public void ComboBoxUiaTextProvider_GetLogfont_ReturnSegoe_ByDefault(ComboBoxStyle dropDownStyle) 1092[InlineData(ComboBoxStyle.DropDown)] 1093[InlineData(ComboBoxStyle.Simple)] 1094public void ComboBoxUiaTextProvider_GetLogfont_ReturnEmpty_WithoutHandle(ComboBoxStyle dropDownStyle) 1107[InlineData(ComboBoxStyle.DropDown)] 1108[InlineData(ComboBoxStyle.Simple)] 1109public void ComboBoxUiaTextProvider_FirstVisibleLine_DefaultValueCorrect(ComboBoxStyle dropDownStyle) 1121[InlineData(ComboBoxStyle.DropDown)] 1122[InlineData(ComboBoxStyle.Simple)] 1123public void ComboBoxUiaTextProvider_LinesCount_DefaultValueCorrect(ComboBoxStyle dropDownStyle) 1135[InlineData(ComboBoxStyle.DropDown, 50, 20, 0)] 1136[InlineData(ComboBoxStyle.DropDown, 50, 20, 50)] 1137[InlineData(ComboBoxStyle.DropDown, 50, 20, 200)] 1138[InlineData(ComboBoxStyle.DropDown, 50, 20, -5)] 1139[InlineData(ComboBoxStyle.Simple, 50, 20, 0)] 1140[InlineData(ComboBoxStyle.Simple, 50, 20, 50)] 1141[InlineData(ComboBoxStyle.Simple, 50, 20, 200)] 1142[InlineData(ComboBoxStyle.Simple, 50, 20, -5)] 1144ComboBoxStyle dropDownStyle, 1164[InlineData(ComboBoxStyle.DropDown, 0)] 1165[InlineData(ComboBoxStyle.DropDown, 2)] 1166[InlineData(ComboBoxStyle.Simple, 0)] 1167[InlineData(ComboBoxStyle.Simple, 2)] 1168public void ComboBoxUiaTextProvider_LineScroll_DefaultValueCorrect(ComboBoxStyle dropDownStyle, int newLine)
System\Windows\Forms\ComboBoxTests.cs (36)
71Assert.Equal(ComboBoxStyle.DropDown, control.DropDownStyle); 463control.DropDownStyle = ComboBoxStyle.DropDownList; 465if (control.DropDownStyle == ComboBoxStyle.DropDownList) 478control.DropDownStyle = ComboBoxStyle.DropDown; 489control.DropDownStyle = ComboBoxStyle.DropDownList; 491if (control.DropDownStyle == ComboBoxStyle.DropDownList) 822[EnumData<ComboBoxStyle>] 823public void ComboBox_DropDownStyle_Set_GetReturnsExpected(ComboBoxStyle value) 844yield return new object[] { source, mode, ComboBoxStyle.Simple, mode }; 845yield return new object[] { source, mode, ComboBoxStyle.DropDown, mode }; 846yield return new object[] { source, mode, ComboBoxStyle.DropDownList, source != AutoCompleteSource.ListItems ? AutoCompleteMode.None : mode }; 853public void ComboBox_DropDownStyle_SetWithSourceAndMode_GetReturnsExpected(AutoCompleteSource source, AutoCompleteMode mode, ComboBoxStyle value, AutoCompleteMode expectedMode) 900control.DropDownStyle = ComboBoxStyle.DropDownList; 903control.DropDownStyle = ComboBoxStyle.Simple; 907control.DropDownStyle = ComboBoxStyle.DropDownList; 912[InlineData(ComboBoxStyle.Simple, 1)] 913[InlineData(ComboBoxStyle.DropDown, 0)] 914[InlineData(ComboBoxStyle.DropDownList, 1)] 915public void ComboBox_DropDownStyle_SetWithHandle_GetReturnsExpected(ComboBoxStyle value, int expectedCreatedCallCount) 956control.DropDownStyle = ComboBoxStyle.DropDownList; 957Assert.Equal(ComboBoxStyle.DropDownList, control.DropDownStyle); 961control.DropDownStyle = ComboBoxStyle.DropDownList; 962Assert.Equal(ComboBoxStyle.DropDownList, control.DropDownStyle); 966control.DropDownStyle = ComboBoxStyle.Simple; 967Assert.Equal(ComboBoxStyle.Simple, control.DropDownStyle); 972control.DropDownStyle = ComboBoxStyle.DropDownList; 973Assert.Equal(ComboBoxStyle.DropDownList, control.DropDownStyle); 978[InvalidEnumData<ComboBoxStyle>] 979public void ComboBox_DropDownStyle_SetInvalidValue_ThrowsInvalidEnumArgumentException(ComboBoxStyle value) 2151[InlineData(ComboBoxStyle.DropDown)] 2152[InlineData(ComboBoxStyle.DropDownList)] 2153[InlineData(ComboBoxStyle.Simple)] 2154public void Combobox_SetCustomSize_DoesNotCreateHandle(ComboBoxStyle dropDownStyle) 2734comboBox.DropDownStyle.Should().Be(ComboBoxStyle.DropDown); 2736comboBox.DropDownStyle = ComboBoxStyle.Simple; 2740comboBox.DropDownStyle.Should().Be(ComboBoxStyle.Simple);
System\Windows\Forms\ToolStripComboBoxTests.cs (7)
162[InlineData(ComboBoxStyle.Simple)] 163[InlineData(ComboBoxStyle.DropDown)] 164[InlineData(ComboBoxStyle.DropDownList)] 165public void ToolStripComboBox_DropDownStyle_SetAndGet(ComboBoxStyle style) 274_toolStripComboBox.DropDownStyle.Should().Be(ComboBoxStyle.DropDown); 288_toolStripComboBox.DropDownStyle = ComboBoxStyle.DropDownList; 289_toolStripComboBox.DropDownStyle.Should().Be(ComboBoxStyle.DropDownList);
WinFormsControlsTest (12)
ComboBoxes.Designer.cs (9)
67this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 106this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 131this.comboBox6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 156this.comboBox8.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 169this.comboBox9.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple; 182this.comboBox10.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple; 195this.comboBox11.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple; 209this.comboBox12.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple; 229this.dataBoundComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple;
ComboBoxesWithScrollBars.Designer.cs (2)
83this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.Simple; 95this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
ToolStripTests.Designer.cs (1)
275this.toolStripComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;