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