189 references to DrawMode
PresentationUI (1)
MS\Internal\Documents\SignatureSummaryDialog.Designer.cs (1)
150_listBoxSummary.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
System.Windows.Forms (38)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (15)
361case DrawMode.OwnerDrawFixed: 364case DrawMode.OwnerDrawVariable: 405[DefaultValue(DrawMode.Normal)] 408public DrawMode DrawMode 410get => Properties.GetValueOrDefault(s_propDrawMode, DrawMode.Normal); 418Properties.AddOrRemoveValue(s_propDrawMode, value, defaultValue: DrawMode.Normal); 579DrawMode drawMode = DrawMode; 580if (drawMode == DrawMode.OwnerDrawFixed || 581drawMode == DrawMode.OwnerDrawVariable || 602if (DrawMode != DrawMode.Normal) 827if (DrawMode != DrawMode.Normal) 1957if (DrawMode != DrawMode.OwnerDrawVariable) 3387if (DrawMode == DrawMode.OwnerDrawFixed) 3392else if (DrawMode == DrawMode.OwnerDrawVariable) 3607if (DrawMode == DrawMode.OwnerDrawVariable && itemID >= 0)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (2)
132public override DrawMode DrawMode 136return DrawMode.Normal;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (20)
67private DrawMode _drawMode = DrawMode.Normal; 326case DrawMode.Normal: 328case DrawMode.OwnerDrawFixed: 331case DrawMode.OwnerDrawVariable: 390[DefaultValue(DrawMode.Normal)] 393public virtual DrawMode DrawMode 406if (MultiColumn && value == DrawMode.OwnerDrawVariable) 413if (_drawMode == DrawMode.OwnerDrawVariable) 579if (_drawMode is DrawMode.OwnerDrawFixed or DrawMode.OwnerDrawVariable) 595if (_drawMode == DrawMode.OwnerDrawFixed && IsHandleCreated) 655if (DrawMode != DrawMode.Normal) 690if (value && _drawMode == DrawMode.OwnerDrawVariable) 714if (_drawMode == DrawMode.OwnerDrawVariable) 1418if (_drawMode != DrawMode.OwnerDrawVariable) 1754if (_drawMode == DrawMode.OwnerDrawFixed) 1949if (_drawMode == DrawMode.OwnerDrawVariable) 2167return ItemHeight != DefaultListBoxItemHeight && _drawMode != DrawMode.Normal; 2379if (_drawMode == DrawMode.OwnerDrawVariable && mis->itemID >= 0)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (1)
316DrawMode = DrawMode.OwnerDrawFixed
System.Windows.Forms.Design (5)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (1)
431_listBox.DrawMode = DrawMode.OwnerDrawFixed;
System\Drawing\Design\ColorEditor.ColorUI.cs (2)
180DrawMode = DrawMode.OwnerDrawFixed, 194DrawMode = DrawMode.OwnerDrawFixed,
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
24DrawMode = DrawMode.OwnerDrawFixed;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (1)
523_selectedColumns.DrawMode = DrawMode.OwnerDrawFixed;
System.Windows.Forms.Tests (133)
CheckedListBoxTests.cs (7)
72DrawMode result = box.DrawMode; 74Assert.Equal(DrawMode.Normal, result); 82box.DrawMode.Should().Be(DrawMode.Normal); 84box.DrawMode = DrawMode.OwnerDrawFixed; 85box.DrawMode.Should().Be(DrawMode.Normal); 87box.DrawMode = DrawMode.OwnerDrawVariable; 88box.DrawMode.Should().Be(DrawMode.Normal);
System\Windows\Forms\AccessibleObjects\ComboBox.ComboBoxItemAccessibleObjectTests.cs (1)
477DrawMode = DrawMode.OwnerDrawVariable;
System\Windows\Forms\ComboBoxTests.cs (9)
69Assert.Equal(DrawMode.Normal, control.DrawMode); 2615[InlineData(DrawMode.Normal)] 2616[InlineData(DrawMode.OwnerDrawFixed)] 2617[InlineData(DrawMode.OwnerDrawVariable)] 2618public void ComboBox_GetItemHeight_Invoke_ReturnsExpected(DrawMode drawMode) 2626private ComboBox CreateComboBox(DrawMode drawMode, int itemHeight = 15) 2650using ComboBox control = CreateComboBox(DrawMode.OwnerDrawVariable); 2672control.DrawMode = DrawMode.OwnerDrawVariable; 2757DrawMode = DrawMode.OwnerDrawVariable;
System\Windows\Forms\ListBoxTests.cs (116)
66Assert.Equal(DrawMode.Normal, control.DrawMode); 321[InlineData(DrawMode.Normal, 0x562100C1)] 322[InlineData(DrawMode.OwnerDrawFixed, 0x562100D1)] 323[InlineData(DrawMode.OwnerDrawVariable, 0x562100E1)] 324public void ListBox_CreateParams_GetDrawMode_ReturnsExpected(DrawMode drawMode, int expectedStyle) 874yield return new object[] { autoSize, true, DrawMode.Normal }; 875yield return new object[] { autoSize, false, DrawMode.Normal }; 877yield return new object[] { autoSize, true, DrawMode.OwnerDrawFixed }; 878yield return new object[] { autoSize, false, DrawMode.OwnerDrawFixed }; 880yield return new object[] { autoSize, false, DrawMode.OwnerDrawVariable }; 886public void ListBox_DrawMode_Set_GetReturnsExpected(bool autoSize, bool multiColumn, DrawMode value) 910yield return new object[] { true, true, DrawMode.Normal, 0 }; 911yield return new object[] { true, false, DrawMode.Normal, 0 }; 912yield return new object[] { false, true, DrawMode.Normal, 0 }; 913yield return new object[] { false, false, DrawMode.Normal, 0 }; 915yield return new object[] { true, true, DrawMode.OwnerDrawFixed, 0 }; 916yield return new object[] { true, false, DrawMode.OwnerDrawFixed, 0 }; 917yield return new object[] { false, true, DrawMode.OwnerDrawFixed, 0 }; 918yield return new object[] { false, false, DrawMode.OwnerDrawFixed, 0 }; 920yield return new object[] { true, false, DrawMode.OwnerDrawVariable, 1 }; 921yield return new object[] { false, false, DrawMode.OwnerDrawVariable, 0 }; 926public void ListBox_DrawMode_SetWithParent_GetReturnsExpected(bool autoSize, bool multiColumn, DrawMode value, int expectedParentLayoutCallCount) 975yield return new object[] { autoSize, true, DrawMode.Normal, 0 }; 976yield return new object[] { autoSize, false, DrawMode.Normal, 0 }; 978yield return new object[] { autoSize, true, DrawMode.OwnerDrawFixed, 1 }; 979yield return new object[] { autoSize, false, DrawMode.OwnerDrawFixed, 1 }; 981yield return new object[] { autoSize, false, DrawMode.OwnerDrawVariable, 1 }; 987public void ListBox_DrawMode_SetWithHandle_GetReturnsExpected(bool autoSize, bool multiColumn, DrawMode value, int expectedCreatedCallCount) 1023[InvalidEnumData<DrawMode>] 1024public void ListBox_DrawMode_SetInvalidValue_ThrowsInvalidEnumArgumentException(DrawMode value) 1037Assert.Throws<ArgumentException>("value", () => control.DrawMode = DrawMode.OwnerDrawVariable); 1705foreach (Enum drawMode in Enum.GetValues(typeof(DrawMode))) 1718public void ListBox_ItemHeight_Set_GetReturnsExpected(DrawMode drawMode, bool integralHeight, int value) 1741yield return new object[] { DrawMode.Normal, integralHeight, 1, 0 }; 1742yield return new object[] { DrawMode.Normal, integralHeight, Control.DefaultFont.Height, 0 }; 1743yield return new object[] { DrawMode.Normal, integralHeight, 255, 0 }; 1744yield return new object[] { DrawMode.OwnerDrawFixed, integralHeight, 1, 1 }; 1745yield return new object[] { DrawMode.OwnerDrawFixed, integralHeight, Control.DefaultFont.Height, 0 }; 1746yield return new object[] { DrawMode.OwnerDrawFixed, integralHeight, 255, 1 }; 1747yield return new object[] { DrawMode.OwnerDrawVariable, integralHeight, 1, 0 }; 1748yield return new object[] { DrawMode.OwnerDrawVariable, integralHeight, Control.DefaultFont.Height, 0 }; 1749yield return new object[] { DrawMode.OwnerDrawVariable, integralHeight, 255, 0 }; 1755public void ListBox_ItemHeight_SetWithHandle_GetReturnsExpected(DrawMode drawMode, bool integralHeight, int value, int expectedInvalidatedCallCount) 1789[InlineData(DrawMode.Normal, false)] 1790[InlineData(DrawMode.OwnerDrawFixed, true)] 1791[InlineData(DrawMode.OwnerDrawVariable, false)] 1792public void ListBox_ItemHeight_Set_GetItemHeight_ReturnsExpected(DrawMode drawMode, bool expected) 1818Assert.True(control.DrawMode is DrawMode.Normal); 1874yield return new object[] { DrawMode.Normal, true }; 1875yield return new object[] { DrawMode.Normal, false }; 1876yield return new object[] { DrawMode.OwnerDrawFixed, true }; 1877yield return new object[] { DrawMode.OwnerDrawFixed, false }; 1882public void ListBox_MultiColumn_Set_GetReturnsExpected(DrawMode drawMode, bool value) 1905yield return new object[] { DrawMode.Normal, true, 1 }; 1906yield return new object[] { DrawMode.Normal, false, 0 }; 1907yield return new object[] { DrawMode.OwnerDrawFixed, true, 1 }; 1908yield return new object[] { DrawMode.OwnerDrawFixed, false, 0 }; 1913public void ListBox_MultiColumn_SetWithHandle_GetReturnsExpected(DrawMode drawMode, bool value, int expectedCreatedCallCount) 1956DrawMode = DrawMode.OwnerDrawVariable 2051yield return new object[] { DrawMode.Normal, BorderStyle.Fixed3D, Control.DefaultFont.Height + extra }; 2052yield return new object[] { DrawMode.Normal, BorderStyle.FixedSingle, Control.DefaultFont.Height + extra }; 2053yield return new object[] { DrawMode.Normal, BorderStyle.None, Control.DefaultFont.Height }; 2055yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.Fixed3D, Control.DefaultFont.Height + extra }; 2056yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.FixedSingle, Control.DefaultFont.Height + extra }; 2057yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.None, Control.DefaultFont.Height }; 2059yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.Fixed3D, extra }; 2060yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.FixedSingle, extra }; 2061yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.None, 0 }; 2066public void ListBox_PreferredHeight_GetEmpty_ReturnsExpected(DrawMode drawMode, BorderStyle borderStyle, int expected) 2080yield return new object[] { DrawMode.Normal, BorderStyle.Fixed3D, (Control.DefaultFont.Height * 2) + extra }; 2081yield return new object[] { DrawMode.Normal, BorderStyle.FixedSingle, (Control.DefaultFont.Height * 2) + extra }; 2082yield return new object[] { DrawMode.Normal, BorderStyle.None, (Control.DefaultFont.Height * 2) }; 2084yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.Fixed3D, (Control.DefaultFont.Height * 2) + extra }; 2085yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.FixedSingle, (Control.DefaultFont.Height * 2) + extra }; 2086yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.None, (Control.DefaultFont.Height * 2) }; 2088yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.Fixed3D, (Control.DefaultFont.Height * 2) + extra }; 2089yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.FixedSingle, (Control.DefaultFont.Height * 2) + extra }; 2090yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.None, (Control.DefaultFont.Height * 2) }; 2095public void ListBox_PreferredHeight_GetNotEmpty_ReturnsExpected(DrawMode drawMode, BorderStyle borderStyle, int expected) 2110yield return new object[] { DrawMode.Normal, BorderStyle.Fixed3D }; 2111yield return new object[] { DrawMode.Normal, BorderStyle.FixedSingle }; 2112yield return new object[] { DrawMode.Normal, BorderStyle.None }; 2114yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.Fixed3D }; 2115yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.FixedSingle }; 2116yield return new object[] { DrawMode.OwnerDrawFixed, BorderStyle.None }; 2118yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.Fixed3D }; 2119yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.FixedSingle }; 2120yield return new object[] { DrawMode.OwnerDrawVariable, BorderStyle.None }; 2125public void ListBox_PreferredHeight_GetEmptyWithHandle_ReturnsExpected(DrawMode drawMode, BorderStyle borderStyle) 2149public void ListBox_PreferredHeight_GetNotEmptyWithHandle_ReturnsExpected(DrawMode drawMode, BorderStyle borderStyle) 5142[EnumData<DrawMode>] 5143public void ListBox_GetItemHeight_InvokeEmptyWithoutHandle_ReturnsExpected(DrawMode drawMode) 5155foreach (DrawMode drawMode in Enum.GetValues(typeof(DrawMode))) 5164public void ListBox_GetItemHeight_InvokeNotEmptyWithoutHandle_ReturnsExpected(DrawMode drawMode, int index) 5177[InlineData(DrawMode.Normal)] 5178[InlineData(DrawMode.OwnerDrawFixed)] 5179[InlineData(DrawMode.OwnerDrawVariable)] 5180public void ListBox_GetItemHeight_InvokeEmptyWithHandle_ReturnsExpected(DrawMode drawMode) 5203public void ListBox_GetItemHeight_InvokeNotEmptyWithHandle_ReturnsExpected(DrawMode drawMode, int index) 5228yield return new object[] { DrawMode.Normal, 0, 0, 0, 0 }; 5229yield return new object[] { DrawMode.Normal, 1, 0, -2, -2 }; 5230yield return new object[] { DrawMode.Normal, 0, 0, 10, 10 }; 5231yield return new object[] { DrawMode.OwnerDrawFixed, 0, 0, 0, 0 }; 5232yield return new object[] { DrawMode.OwnerDrawFixed, 1, 0, -2, -2 }; 5233yield return new object[] { DrawMode.OwnerDrawFixed, 0, 0, 10, 10 }; 5234yield return new object[] { DrawMode.OwnerDrawVariable, 0, 0, 0, 0 }; 5235yield return new object[] { DrawMode.OwnerDrawVariable, 1, 1, -2, -2 }; 5236yield return new object[] { DrawMode.OwnerDrawVariable, 0, 0, 10, 10 }; 5241public void ListBox_GetItemHeight_InvokeCustomGetItemHeight_ReturnsExpected(DrawMode drawMode, int index, int expectedIndex, int getItemRectResult, int expected) 6283[InlineData(DrawMode.OwnerDrawVariable, true)] 6284[InlineData(DrawMode.OwnerDrawFixed, false)] 6285[InlineData(DrawMode.Normal, false)] 6286public void ListBox_Refresh_CallsOnMeasureItemBasedOnDrawMode(DrawMode drawMode, bool expectedMeasureItemCalled) 6355DrawMode = DrawMode.Normal, 6379DrawMode = DrawMode.Normal,
WinFormsControlsTest (12)
ComboBoxesWithScrollBars.cs (9)
41useDifferentHeightsCheckBox1.Checked = comboBox1.DrawMode == DrawMode.OwnerDrawVariable; 42useDifferentHeightsCheckBox2.Checked = comboBox2.DrawMode == DrawMode.OwnerDrawVariable; 43useDifferentHeightsCheckBox3.Checked = comboBox3.DrawMode == DrawMode.OwnerDrawVariable; 79comboBox1.DrawMode = DrawMode.OwnerDrawVariable; 84comboBox1.DrawMode = DrawMode.OwnerDrawFixed; 95comboBox2.DrawMode = DrawMode.OwnerDrawVariable; 100comboBox2.DrawMode = DrawMode.OwnerDrawFixed; 112comboBox3.DrawMode = DrawMode.OwnerDrawVariable; 119comboBox3.DrawMode = DrawMode.OwnerDrawFixed;
ListBoxes.Designer.cs (3)
67this.listBox1.DrawMode = System.Windows.Forms.DrawMode.Normal; 136this.listBox3.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; 172this.listBox4.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;