400 references to HorizontalAlignment
System.Windows.Forms (91)
System\Windows\Forms\Control.cs (8)
10511
protected
HorizontalAlignment
RtlTranslateAlignment(
HorizontalAlignment
align)
10529
protected
HorizontalAlignment
RtlTranslateHorizontal(
HorizontalAlignment
align)
10533
if (align ==
HorizontalAlignment
.Left)
10535
return
HorizontalAlignment
.Right;
10537
else if (align ==
HorizontalAlignment
.Right)
10539
return
HorizontalAlignment
.Left;
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxEditingControl.cs (4)
300
private static
HorizontalAlignment
TranslateAlignment(DataGridViewContentAlignment align)
304
return
HorizontalAlignment
.Right;
308
return
HorizontalAlignment
.Center;
312
return
HorizontalAlignment
.Left;
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (7)
29
private
HorizontalAlignment
_textAlign =
HorizontalAlignment
.Left;
326
[DefaultValue(
HorizontalAlignment
.Left)]
327
public
HorizontalAlignment
TextAlign
338
_textAlign =
HorizontalAlignment
.Right;
352
if (Index == 0 && _textAlign !=
HorizontalAlignment
.Left)
354
_textAlign =
HorizontalAlignment
.Left;
System\Windows\Forms\Controls\ListView\DrawListViewColumnHeaderEventArgs.cs (4)
127
HorizontalAlignment
hAlign = Header?.TextAlign ??
HorizontalAlignment
.Left;
128
TextFormatFlags flags = (hAlign ==
HorizontalAlignment
.Left) ? TextFormatFlags.Left :
129
((hAlign ==
HorizontalAlignment
.Center) ? TextFormatFlags.HorizontalCenter :
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (4)
123
HorizontalAlignment
hAlign = Header?.TextAlign ??
HorizontalAlignment
.Left;
124
TextFormatFlags flags = (hAlign ==
HorizontalAlignment
.Left) ? TextFormatFlags.Left :
125
((hAlign ==
HorizontalAlignment
.Center) ? TextFormatFlags.HorizontalCenter :
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (6)
173
public virtual ColumnHeader Add(string? text, int width,
HorizontalAlignment
textAlign)
233
public virtual ColumnHeader Add(string? key, string? text, int width,
HorizontalAlignment
textAlign, string imageKey)
245
public virtual ColumnHeader Add(string? key, string? text, int width,
HorizontalAlignment
textAlign, int imageIndex)
416
public void Insert(int index, string? text, int width,
HorizontalAlignment
textAlign)
469
public void Insert(int index, string? key, string? text, int width,
HorizontalAlignment
textAlign, string imageKey)
481
public void Insert(int index, string? key, string? text, int width,
HorizontalAlignment
textAlign, int imageIndex)
System\Windows\Forms\Controls\ListView\ListView.cs (6)
5727
case
HorizontalAlignment
.Left:
5730
case
HorizontalAlignment
.Right:
5733
case
HorizontalAlignment
.Center:
5754
case
HorizontalAlignment
.Left:
5757
case
HorizontalAlignment
.Right:
5760
case
HorizontalAlignment
.Center:
System\Windows\Forms\Controls\ListView\ListViewGroup.cs (14)
20
private
HorizontalAlignment
_headerAlignment =
HorizontalAlignment
.Left;
22
private
HorizontalAlignment
_footerAlignment =
HorizontalAlignment
.Left;
72
public ListViewGroup(string? header,
HorizontalAlignment
headerAlignment) : this(header)
104
[DefaultValue(
HorizontalAlignment
.Left)]
106
public
HorizontalAlignment
HeaderAlignment
148
/// One of the <see cref="
HorizontalAlignment
"/> values that specifies the alignment of the footer text.
149
/// The default is <see cref="
HorizontalAlignment
.Left"/>.
152
/// The specified value when setting this property is not a valid <see cref="
HorizontalAlignment
"/> value.
154
[DefaultValue(
HorizontalAlignment
.Left)]
156
public
HorizontalAlignment
FooterAlignment
355
HeaderAlignment = (
HorizontalAlignment
)entry.Value!;
363
FooterAlignment = (
HorizontalAlignment
)entry.Value!;
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (1)
95
ConstructorInfo ctor = typeof(ListViewGroup).GetConstructor([typeof(string), typeof(
HorizontalAlignment
)])!;
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (10)
657
[DefaultValue(
HorizontalAlignment
.Left)]
661
public unsafe
HorizontalAlignment
SelectionAlignment
665
HorizontalAlignment
selectionAlignment =
HorizontalAlignment
.Left;
682
selectionAlignment =
HorizontalAlignment
.Left;
686
selectionAlignment =
HorizontalAlignment
.Right;
690
selectionAlignment =
HorizontalAlignment
.Center;
711
case
HorizontalAlignment
.Left:
715
case
HorizontalAlignment
.Right:
719
case
HorizontalAlignment
.Center:
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (7)
103
private
HorizontalAlignment
_textAlign;
316
HorizontalAlignment
align = RtlTranslateHorizontal(_textAlign);
320
case
HorizontalAlignment
.Left:
323
case
HorizontalAlignment
.Center:
326
case
HorizontalAlignment
.Right:
1238
[DefaultValue(
HorizontalAlignment
.Left)]
1240
public
HorizontalAlignment
TextAlign
System\Windows\Forms\Controls\TextBox\TextBox.cs (15)
50
private
HorizontalAlignment
_textAlign =
HorizontalAlignment
.Left;
286
HorizontalAlignment
align = RtlTranslateHorizontal(_textAlign);
293
case
HorizontalAlignment
.Left:
296
case
HorizontalAlignment
.Center:
299
case
HorizontalAlignment
.Right:
308
&& _textAlign ==
HorizontalAlignment
.Left
443
[DefaultValue(
HorizontalAlignment
.Left)]
445
public
HorizontalAlignment
TextAlign
876
case
HorizontalAlignment
.Center:
880
case
HorizontalAlignment
.Left:
884
case
HorizontalAlignment
.Right:
895
case
HorizontalAlignment
.Center:
899
case
HorizontalAlignment
.Left:
903
case
HorizontalAlignment
.Right:
System\Windows\Forms\Controls\ToolStrips\ToolStripTextBox.cs (2)
352
[DefaultValue(
HorizontalAlignment
.Left)]
354
public
HorizontalAlignment
TextBoxTextAlign
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (2)
402
[DefaultValue(
HorizontalAlignment
.Left)]
404
public
HorizontalAlignment
TextAlign
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
899
_pageCounter.TextAlign =
HorizontalAlignment
.Right;
System.Windows.Forms.Design (1)
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (1)
50
TextAlign =
HorizontalAlignment
.Left,
System.Windows.Forms.Tests (298)
MaskedTextBoxTests.cs (9)
41
_maskedTextBox.TextAlign.Should().Be(
HorizontalAlignment
.Left);
657
[InlineData(
HorizontalAlignment
.Left)]
658
[InlineData(
HorizontalAlignment
.Center)]
659
[InlineData(
HorizontalAlignment
.Right)]
660
public void MaskedTextBox_TextAlign_Set_GetReturnsExpected(
HorizontalAlignment
alignment)
665
HorizontalAlignment
originalAlignment = control.TextAlign;
668
HorizontalAlignment
actualAlignment = control.TextAlign;
695
control.TextAlign =
HorizontalAlignment
.Center;
699
control.TextAlign =
HorizontalAlignment
.Right;
SerializableTypesTests.cs (2)
126
ListViewGroup listViewGroup = new("Header",
HorizontalAlignment
.Center)
146
Assert.Equal(
HorizontalAlignment
.Center, result.HeaderAlignment);
System\Windows\Forms\ColumnHeaderCollectionTests.cs (17)
197
yield return new object[] { null, -1,
HorizontalAlignment
.Left, string.Empty };
198
yield return new object[] { string.Empty, 0,
HorizontalAlignment
.Center, string.Empty };
199
yield return new object[] { "text", 1,
HorizontalAlignment
.Right, "text" };
204
public void ColumnHeaderCollection_Add_String_Int_HorizontalAlignment_Success(string text, int width,
HorizontalAlignment
textAlign, string expectedText)
265
yield return new object[] { null, null, -1,
HorizontalAlignment
.Left, -1, string.Empty, string.Empty };
266
yield return new object[] { string.Empty, string.Empty, 0,
HorizontalAlignment
.Center, 0, string.Empty, string.Empty };
267
yield return new object[] { "name", "text", 1,
HorizontalAlignment
.Right, 1, "name", "text" };
272
public void ColumnHeaderCollection_Add_String_String_Int_HorizontalAlignment_Int_Success(string name, string text, int width,
HorizontalAlignment
textAlign, int imageIndex, string expectedName, string expectedText)
290
yield return new object[] { null, null, -1,
HorizontalAlignment
.Left, null, string.Empty, string.Empty, string.Empty };
291
yield return new object[] { string.Empty, string.Empty, 0,
HorizontalAlignment
.Center, string.Empty, string.Empty, string.Empty, string.Empty };
292
yield return new object[] { "name", "text", 1,
HorizontalAlignment
.Right, "imageKey", "name", "text", "imageKey" };
297
public void ColumnHeaderCollection_Add_String_String_Int_HorizontalAlignment_String_Success(string name, string text, int width,
HorizontalAlignment
textAlign, string imageKey, string expectedName, string expectedText, string expectedImageKey)
322
[InvalidEnumData<
HorizontalAlignment
>]
323
public void ColumnHeaderCollection_Add_InvalidTextAlign_ThrowsInvalidEnumArgumentException(
HorizontalAlignment
textAlign)
741
public void ColumnHeaderCollection_Insert_String_Int_HorizontalAlignment_Success(string text, int width,
HorizontalAlignment
textAlign, string expectedText)
782
public void ColumnHeaderCollection_Insert_String_String_Int_HorizontalAlignment_Int_Success(string name, string text, int width,
HorizontalAlignment
textAlign, int imageIndex, string expectedName, string expectedText)
798
public void ColumnHeaderCollection_Insert_String_String_Int_HorizontalAlignment_String_Success(string name, string text, int width,
HorizontalAlignment
textAlign, string imageKey, string expectedName, string expectedText, string expectedImageKey)
System\Windows\Forms\ColumnHeaderTests.cs (58)
31
Assert.Equal(
HorizontalAlignment
.Left, header.TextAlign);
57
Assert.Equal(
HorizontalAlignment
.Left, header.TextAlign);
81
Assert.Equal(
HorizontalAlignment
.Left, header.TextAlign);
1020
[InlineData(RightToLeft.No, true,
HorizontalAlignment
.Left)]
1021
[InlineData(RightToLeft.Yes, true,
HorizontalAlignment
.Left)]
1022
[InlineData(RightToLeft.Inherit, true,
HorizontalAlignment
.Left)]
1023
[InlineData(RightToLeft.No, false,
HorizontalAlignment
.Left)]
1024
[InlineData(RightToLeft.Yes, false,
HorizontalAlignment
.Right)]
1025
[InlineData(RightToLeft.Inherit, false,
HorizontalAlignment
.Left)]
1026
public void ColumnHeader_TextAlign_GetWithListView_ReturnsExpected(RightToLeft rightToLeft, bool rightToLeftLayout,
HorizontalAlignment
expected)
1037
Assert.Equal(
HorizontalAlignment
.Left, header1.TextAlign);
1041
Assert.Equal(
HorizontalAlignment
.Left, header1.TextAlign);
1047
Assert.Equal(
HorizontalAlignment
.Left, header1.TextAlign);
1106
[EnumData<
HorizontalAlignment
>]
1107
public void ColumnHeader_TextAlign_SetWithoutListView_GetReturnsExpected(
HorizontalAlignment
value)
1121
[InlineData(0,
HorizontalAlignment
.Center,
HorizontalAlignment
.Left)]
1122
[InlineData(0,
HorizontalAlignment
.Left,
HorizontalAlignment
.Left)]
1123
[InlineData(0,
HorizontalAlignment
.Right,
HorizontalAlignment
.Left)]
1124
[InlineData(1,
HorizontalAlignment
.Center,
HorizontalAlignment
.Center)]
1125
[InlineData(1,
HorizontalAlignment
.Left,
HorizontalAlignment
.Left)]
1126
[InlineData(1,
HorizontalAlignment
.Right,
HorizontalAlignment
.Right)]
1127
public void ColumnHeader_TextAlign_SetWithListView_GetReturnsExpected(int columnIndex,
HorizontalAlignment
value,
HorizontalAlignment
expected)
1146
[InlineData(0,
HorizontalAlignment
.Center,
HorizontalAlignment
.Left)]
1147
[InlineData(0,
HorizontalAlignment
.Left,
HorizontalAlignment
.Left)]
1148
[InlineData(0,
HorizontalAlignment
.Right,
HorizontalAlignment
.Left)]
1149
[InlineData(1,
HorizontalAlignment
.Center,
HorizontalAlignment
.Center)]
1150
[InlineData(1,
HorizontalAlignment
.Left,
HorizontalAlignment
.Left)]
1151
[InlineData(1,
HorizontalAlignment
.Right,
HorizontalAlignment
.Right)]
1152
public void ColumnHeader_TextAlign_SetWithListViewWithHandle_GetReturnsExpected(int columnIndex,
HorizontalAlignment
value,
HorizontalAlignment
expected)
1184
[InlineData(0,
HorizontalAlignment
.Center, 0x4000)]
1185
[InlineData(0,
HorizontalAlignment
.Left, 0x4000)]
1186
[InlineData(0,
HorizontalAlignment
.Right, 0x4000)]
1187
[InlineData(1,
HorizontalAlignment
.Center, 0x4002)]
1188
[InlineData(1,
HorizontalAlignment
.Left, 0x4000)]
1189
[InlineData(1,
HorizontalAlignment
.Right, 0x4001)]
1190
public unsafe void ColumnHeader_TextAlign_GetColumn_Success(int columnIndex,
HorizontalAlignment
value, int expected)
1209
[InvalidEnumData<
HorizontalAlignment
>]
1210
public void ColumnHeader_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
HorizontalAlignment
value)
1469
TextAlign =
HorizontalAlignment
.Center,
1485
Assert.Equal(
HorizontalAlignment
.Center, header.TextAlign);
1506
TextAlign =
HorizontalAlignment
.Center,
1524
Assert.Equal(
HorizontalAlignment
.Center, header.TextAlign);
1544
TextAlign =
HorizontalAlignment
.Center,
1564
Assert.Equal(
HorizontalAlignment
.Center, header.TextAlign);
System\Windows\Forms\ControlTests.cs (4)
1412
public new
HorizontalAlignment
RtlTranslateAlignment(
HorizontalAlignment
align) => base.RtlTranslateAlignment(align);
1420
public new
HorizontalAlignment
RtlTranslateHorizontal(
HorizontalAlignment
align) => base.RtlTranslateHorizontal(align);
System\Windows\Forms\ControlTests.Methods.cs (12)
6900
public void Control_RtlTranslateAlignment_InvokeHorizontalAlignment_ReturnsExpected(RightToLeft rightToLeft,
HorizontalAlignment
align,
HorizontalAlignment
expected)
6979
foreach (
HorizontalAlignment
align in Enum.GetValues(typeof(
HorizontalAlignment
)))
6985
yield return new object[] { RightToLeft.Yes,
HorizontalAlignment
.Center,
HorizontalAlignment
.Center };
6986
yield return new object[] { RightToLeft.Yes,
HorizontalAlignment
.Left,
HorizontalAlignment
.Right };
6987
yield return new object[] { RightToLeft.Yes,
HorizontalAlignment
.Right,
HorizontalAlignment
.Left };
6992
public void Control_RtlTranslateHorizontal_Invoke_ReturnsExpected(RightToLeft rightToLeft,
HorizontalAlignment
align,
HorizontalAlignment
expected)
System\Windows\Forms\DataGridViewTextBoxEditingControlTests.cs (45)
120
Assert.Equal(
HorizontalAlignment
.Left, control.TextAlign);
546
yield return new object[] { new DataGridViewCellStyle(), null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false };
555
yield return new object[] { customStyle, font, Color.Gray, Color.Green, false,
HorizontalAlignment
.Left, false };
563
yield return new object[] { transparentStyle, font, Color.FromArgb(0xFF, 0x34, 0x56, 0x78), Color.FromArgb(0x23, 0x45, 0x67, 0x80), false,
HorizontalAlignment
.Left, false };
572
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Center, false
581
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Center, true
590
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false
599
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Left, true
608
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Right, false
617
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Right, true
627
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Center, false
636
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Center, true
645
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false
654
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Left, true
663
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Right, false
672
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Right, true
682
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Center, false
691
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Center, false
700
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false
709
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Left, false
718
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Right, false
727
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Right, false
733
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_Invoke_Success(DataGridViewCellStyle dataGridViewCellStyle, Font expectedFont, Color expectedBackColor, Color expectedForeColor, bool expectedWordWrap,
HorizontalAlignment
expectedTextAlign, bool expectedRepositionOnValueChange)
755
yield return new object[] { new DataGridViewCellStyle(), null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false };
764
yield return new object[] { customStyle, font, Color.Gray, SystemColors.Control, Color.Green, false,
HorizontalAlignment
.Left, false };
772
yield return new object[] { transparentStyle, font, Color.FromArgb(0xFF, 0x34, 0x56, 0x78), Color.FromArgb(0xFF, 0x34, 0x56, 0x78), Color.FromArgb(0x23, 0x45, 0x67, 0x80), false,
HorizontalAlignment
.Left, false };
781
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Center, false
790
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Center, true
799
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false
808
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Left, true
817
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Right, false
826
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Right, true
836
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Center, false
845
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Center, true
854
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false
863
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Left, true
872
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Right, false
881
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Right, true
891
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Center, false
900
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Center, false
909
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Left, false
918
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Left, false
927
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, false,
HorizontalAlignment
.Right, false
936
null, Color.FromArgb(0xFF, 0x00, 0x00, 0x00), Color.FromArgb(0xFF, 0x00, 0x00, 0x00), SystemColors.WindowText, true,
HorizontalAlignment
.Right, false
942
public void DataGridViewTextBoxEditingDataGridViewTextBoxEditingControl_ApplyCellStyleToEditingDataGridViewTextBoxEditingControl_InvokeWithDataGridView_Success(DataGridViewCellStyle dataGridViewCellStyle, Font expectedFont, Color expectedBackColor, Color expectedEditingPanelBackColor, Color expectedForeColor, bool expectedWordWrap,
HorizontalAlignment
expectedTextAlign, bool expectedRepositionOnValueChange)
System\Windows\Forms\DomainUpDownTests.cs (1)
140
_sub.TextAlign.Should().Be(
HorizontalAlignment
.Left);
System\Windows\Forms\DrawListViewColumnHeaderEventArgsTests.cs (4)
82
[InlineData(
HorizontalAlignment
.Left)]
83
[InlineData(
HorizontalAlignment
.Center)]
84
[InlineData(
HorizontalAlignment
.Right)]
85
public void DrawListViewColumnHeaderEventArgs_DrawText_Invoke_Success(
HorizontalAlignment
textAlign)
System\Windows\Forms\ListViewGroupConverterTests.cs (9)
175
new Type[] { typeof(string), typeof(
HorizontalAlignment
) },
176
new object[] { "ListViewGroup",
HorizontalAlignment
.Left }
181
new Type[] { typeof(string), typeof(
HorizontalAlignment
) },
182
new object[] { "headerText",
HorizontalAlignment
.Left }
187
new Type[] { typeof(string), typeof(
HorizontalAlignment
) },
188
new object[] { "header",
HorizontalAlignment
.Left }
192
new ListViewGroup("header",
HorizontalAlignment
.Center),
193
new Type[] { typeof(string), typeof(
HorizontalAlignment
) },
194
new object[] { "header",
HorizontalAlignment
.Center }
System\Windows\Forms\ListViewGroupTests.cs (52)
19
Assert.Equal(
HorizontalAlignment
.Left, group.FooterAlignment);
21
Assert.Equal(
HorizontalAlignment
.Left, group.HeaderAlignment);
40
Assert.Equal(
HorizontalAlignment
.Left, group.FooterAlignment);
42
Assert.Equal(
HorizontalAlignment
.Left, group.HeaderAlignment);
57
yield return new object[] { null,
HorizontalAlignment
.Left, string.Empty };
58
yield return new object[] { string.Empty,
HorizontalAlignment
.Right, string.Empty };
59
yield return new object[] { "reasonable",
HorizontalAlignment
.Center, "reasonable" };
60
yield return new object[] { "reasonable",
HorizontalAlignment
.Left - 1, "reasonable" };
61
yield return new object[] { "reasonable",
HorizontalAlignment
.Center + 1, "reasonable" };
66
public void ListViewGroup_Ctor_String_HorizontalAlignment(string header,
HorizontalAlignment
headerAlignment, string expectedHeader)
70
Assert.Equal(
HorizontalAlignment
.Left, group.FooterAlignment);
98
Assert.Equal(
HorizontalAlignment
.Left, group.FooterAlignment);
100
Assert.Equal(
HorizontalAlignment
.Left, group.HeaderAlignment);
640
foreach (
HorizontalAlignment
value in Enum.GetValues(typeof(
HorizontalAlignment
)))
650
public void ListViewGroup_FooterAlignment_SetWithoutListView_GetReturnsExpected(string footer,
HorizontalAlignment
value, string expectedFooter)
669
public void ListViewGroup_FooterAlignment_SetWithListView_GetReturnsExpected(string footer,
HorizontalAlignment
value, string expectedFooter)
693
public void ListViewGroup_FooterAlignment_SetWithListViewWithHandle_GetReturnsExpected(string footer,
HorizontalAlignment
value, string expectedFooter)
730
yield return new object[] { string.Empty,
HorizontalAlignment
.Left, 0x00000008 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_HEADER_LEFT };
731
yield return new object[] { string.Empty,
HorizontalAlignment
.Center, 0x00000010 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_HEADER_LEFT };
732
yield return new object[] { string.Empty,
HorizontalAlignment
.Right, 0x00000020 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_HEADER_LEFT };
734
yield return new object[] { "footer",
HorizontalAlignment
.Left, 0x00000008 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_HEADER_LEFT };
735
yield return new object[] { "footer",
HorizontalAlignment
.Center, 0x00000010 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_HEADER_LEFT };
736
yield return new object[] { "footer",
HorizontalAlignment
.Right, 0x00000020 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_HEADER_LEFT };
741
public unsafe void ListView_FooterAlignment_GetGroupInfo_Success(string footerParam,
HorizontalAlignment
valueParam, int expectedAlignParam)
746
HorizontalAlignment
value = (
HorizontalAlignment
)Enum.Parse(typeof(
HorizontalAlignment
), valueString);
779
[InvalidEnumData<
HorizontalAlignment
>]
780
public void ListViewGroup_FooterAlignment_SetInvalid_ThrowsInvalidEnumArgumentException(
HorizontalAlignment
value)
902
public void ListViewGroup_HeaderAlignment_SetWithoutListView_GetReturnsExpected(string header,
HorizontalAlignment
value, string expectedHeader)
921
public void ListViewGroup_HeaderAlignment_SetWithListView_GetReturnsExpected(string header,
HorizontalAlignment
value, string expectedHeader)
945
public void ListViewGroup_HeaderAlignment_SetWithListViewWithHandle_GetReturnsExpected(string header,
HorizontalAlignment
value, string expectedHeader)
982
yield return new object[] { string.Empty,
HorizontalAlignment
.Left, 0x00000001 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_FOOTER_LEFT };
983
yield return new object[] { string.Empty,
HorizontalAlignment
.Center, 0x00000002 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_FOOTER_LEFT };
984
yield return new object[] { string.Empty,
HorizontalAlignment
.Right, 0x00000004 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_FOOTER_LEFT };
986
yield return new object[] { "header",
HorizontalAlignment
.Left, 0x00000001 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_FOOTER_LEFT };
987
yield return new object[] { "header",
HorizontalAlignment
.Center, 0x00000002 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_FOOTER_LEFT };
988
yield return new object[] { "header",
HorizontalAlignment
.Right, 0x00000004 | (int)LIST_VIEW_GROUP_ALIGN_FLAGS.LVGA_FOOTER_LEFT };
993
public unsafe void ListView_HeaderAlignment_GetGroupInfo_Success(string headerParam,
HorizontalAlignment
valueParam, int expectedAlignParam)
998
HorizontalAlignment
value = (
HorizontalAlignment
)Enum.Parse(typeof(
HorizontalAlignment
), valueString);
1031
[InvalidEnumData<
HorizontalAlignment
>]
1032
public void ListViewGroup_HeaderAlignment_SetInvalid_ThrowsInvalidEnumArgumentException(
HorizontalAlignment
value)
1322
yield return new object[] { new ListViewGroup("header",
HorizontalAlignment
.Center) { Name = "name", Tag = "tag" } };
1373
Assert.Equal(
HorizontalAlignment
.Left, info.GetValue("HeaderAlignment", typeof(
HorizontalAlignment
)));
1391
Assert.Equal(
HorizontalAlignment
.Left, info.GetValue("HeaderAlignment", typeof(
HorizontalAlignment
)));
1409
Assert.Equal(
HorizontalAlignment
.Left, info.GetValue("HeaderAlignment", typeof(
HorizontalAlignment
)));
System\Windows\Forms\ListViewTests.cs (28)
1876
yield return new object[] { showGroups, null,
HorizontalAlignment
.Left, null,
HorizontalAlignment
.Right, string.Empty, string.Empty, 0x00000021 };
1877
yield return new object[] { showGroups, null,
HorizontalAlignment
.Center, null,
HorizontalAlignment
.Center, string.Empty, string.Empty, 0x00000012 };
1878
yield return new object[] { showGroups, null,
HorizontalAlignment
.Right, null,
HorizontalAlignment
.Left, string.Empty, string.Empty, 0x0000000C };
1880
yield return new object[] { showGroups, string.Empty,
HorizontalAlignment
.Left, string.Empty,
HorizontalAlignment
.Right, string.Empty, string.Empty, 0x00000021 };
1881
yield return new object[] { showGroups, string.Empty,
HorizontalAlignment
.Center, string.Empty,
HorizontalAlignment
.Center, string.Empty, string.Empty, 0x00000012 };
1882
yield return new object[] { showGroups, string.Empty,
HorizontalAlignment
.Right, string.Empty,
HorizontalAlignment
.Left, string.Empty, string.Empty, 0x0000000C };
1884
yield return new object[] { showGroups, "header",
HorizontalAlignment
.Left, "footer",
HorizontalAlignment
.Right, "header", "footer", 0x00000021 };
1885
yield return new object[] { showGroups, "header",
HorizontalAlignment
.Center, "footer",
HorizontalAlignment
.Center, "header", "footer", 0x00000012 };
1886
yield return new object[] { showGroups, "header",
HorizontalAlignment
.Right, "footer",
HorizontalAlignment
.Left, "header", "footer", 0x0000000C };
1888
yield return new object[] { showGroups, "he\0der",
HorizontalAlignment
.Left, "fo\0oter",
HorizontalAlignment
.Right, "he", "fo", 0x00000021 };
1889
yield return new object[] { showGroups, "he\0der",
HorizontalAlignment
.Center, "fo\0oter",
HorizontalAlignment
.Center, "he", "fo", 0x00000012 };
1890
yield return new object[] { showGroups, "he\0der",
HorizontalAlignment
.Right, "fo\0oter",
HorizontalAlignment
.Left, "he", "fo", 0x0000000C };
1907
HorizontalAlignment
headerAlignment = (
HorizontalAlignment
)data[2];
1909
HorizontalAlignment
footerAlignment = (
HorizontalAlignment
)data[4];
System\Windows\Forms\RichTextBoxTests.cs (31)
3637
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3641
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3657
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3664
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3673
yield return new object[] { 0, 0,
HorizontalAlignment
.Left };
3674
yield return new object[] { 0, PFA.CENTER,
HorizontalAlignment
.Left };
3675
yield return new object[] { PFM.ALIGNMENT, PFA.LEFT,
HorizontalAlignment
.Left };
3676
yield return new object[] { PFM.ALIGNMENT, PFA.CENTER,
HorizontalAlignment
.Center };
3677
yield return new object[] { PFM.ALIGNMENT, PFA.RIGHT,
HorizontalAlignment
.Right };
3678
yield return new object[] { PFM.ALIGNMENT, PFA.JUSTIFY,
HorizontalAlignment
.Left };
3679
yield return new object[] { PFM.ALIGNMENT, PFA.FULL_INTERWORD,
HorizontalAlignment
.Left };
3680
yield return new object[] { PFM.ALIGNMENT | PFM.ALIGNMENT, PFA.CENTER,
HorizontalAlignment
.Center };
3681
yield return new object[] { PFM.NUMBERING, PFA.CENTER,
HorizontalAlignment
.Left };
3686
public void RichTextBox_SelectionAlignment_CustomGetParaFormat_ReturnsExpected(uint mask, uint alignment,
HorizontalAlignment
expected)
3705
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3718
[EnumData<
HorizontalAlignment
>]
3719
public void RichTextBox_SelectionAlignment_Set_GetReturnsExpected(
HorizontalAlignment
value)
3735
[EnumData<
HorizontalAlignment
>]
3736
public void RichTextBox_SelectionAlignment_SetWithHandle_GetReturnsExpected(
HorizontalAlignment
value)
3764
[InlineData(
HorizontalAlignment
.Left, 1)]
3765
[InlineData(
HorizontalAlignment
.Center, 3)]
3766
[InlineData(
HorizontalAlignment
.Right, 2)]
3767
public unsafe void RichTextBox_SelectionAlignment_GetCharFormat_Success(
HorizontalAlignment
value, int expected)
3786
[InvalidEnumData<
HorizontalAlignment
>]
3787
public void RichTextBox_SelectionAlignment_SetInvalidValue_ThrowsInvalidEnumArgumentException(
HorizontalAlignment
value)
3794
[EnumData<
HorizontalAlignment
>]
3795
public void RichTextBox_SelectionAlignment_SetCantCreateHandle_GetReturnsExpected(
HorizontalAlignment
value)
3799
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3804
Assert.Equal(
HorizontalAlignment
.Left, control.SelectionAlignment);
3809
[EnumData<
HorizontalAlignment
>]
3810
public void RichTextBox_SelectionAlignment_SetDisposed_ThrowsObjectDisposedException(
HorizontalAlignment
value)
System\Windows\Forms\ToolStripTextBoxTests.cs (14)
332
[InlineData(
HorizontalAlignment
.Left)]
333
[InlineData(
HorizontalAlignment
.Center)]
334
[InlineData(
HorizontalAlignment
.Right)]
335
public void ToolStripTextBox_TextBoxTextAlign_GetSet_ReturnsExpected(
HorizontalAlignment
textAlign)
650
_toolStripTextBox.TextBoxTextAlign =
HorizontalAlignment
.Center;
652
_toolStripTextBox.TextBoxTextAlign.Should().Be(
HorizontalAlignment
.Center);
655
_toolStripTextBox.TextBoxTextAlign =
HorizontalAlignment
.Left;
657
_toolStripTextBox.TextBoxTextAlign.Should().Be(
HorizontalAlignment
.Left);
669
_toolStripTextBox.TextBoxTextAlign =
HorizontalAlignment
.Center;
672
_toolStripTextBox.TextBoxTextAlign.Should().Be(
HorizontalAlignment
.Center);
675
_toolStripTextBox.TextBoxTextAlign =
HorizontalAlignment
.Left;
678
_toolStripTextBox.TextBoxTextAlign.Should().Be(
HorizontalAlignment
.Left);
681
_toolStripTextBox.TextBoxTextAlign =
HorizontalAlignment
.Center;
684
_toolStripTextBox.TextBoxTextAlign.Should().Be(
HorizontalAlignment
.Center);
System\Windows\Forms\UpDownBaseTests.cs (7)
123
Assert.Equal(
HorizontalAlignment
.Left, control.TextAlign);
1374
[EnumData<
HorizontalAlignment
>]
1375
public void UpDownBase_TextAlign_Set_GetReturnsExpected(
HorizontalAlignment
value)
1391
[EnumData<
HorizontalAlignment
>]
1392
public void UpDownBase_TextAlign_SetWithHandle_GetReturnsExpected(
HorizontalAlignment
value)
1420
[InvalidEnumData<
HorizontalAlignment
>]
1421
public void UpDownBase_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
HorizontalAlignment
value)
TextBoxTests.cs (5)
113
Assert.Equal(
HorizontalAlignment
.Left, control.TextAlign);
421
tb.TextAlign =
HorizontalAlignment
.Center;
423
tb.TextAlign =
HorizontalAlignment
.Right;
440
tb.TextAlign =
HorizontalAlignment
.Center;
442
tb.TextAlign =
HorizontalAlignment
.Right;
System.Windows.Forms.UI.IntegrationTests (1)
ListViewTests.cs (1)
50
ListViewGroup group = new($"Group 1",
HorizontalAlignment
.Left) { CollapsedState = ListViewGroupCollapsedState.Expanded };
WinFormsControlsTest (9)
DataGridViewTest.Designer.cs (1)
174
this.numericUpDown1.TextAlign = System.Windows.Forms.
HorizontalAlignment
.Right;
ListViewTest.cs (4)
119
listView2.Columns.Add("column1", "Item Column", -2,
HorizontalAlignment
.Left, 0);
120
listView2.Columns.Add("Column 2", -2,
HorizontalAlignment
.Left);
121
listView2.Columns.Add("Column 3", -2,
HorizontalAlignment
.Left);
122
listView2.Columns.Add("Column 4", -2,
HorizontalAlignment
.Center);
MultipleControls.cs (4)
81
listView2.Columns.Add("column1", "Item Column", -2,
HorizontalAlignment
.Left, 0);
82
listView2.Columns.Add("Column 2", -2,
HorizontalAlignment
.Left);
83
listView2.Columns.Add("Column 3", -2,
HorizontalAlignment
.Left);
84
listView2.Columns.Add("Column 4", -2,
HorizontalAlignment
.Center);