684 references to ContentAlignment
PresentationUI (2)
MS\Internal\Documents\Application\DocumentPropertiesDialog.Designer.cs (1)
396
this._descriptionLabel.ImageAlign = System.Drawing.
ContentAlignment
.TopLeft;
MS\Internal\Documents\RMPermissions.Designer.cs (1)
123
this.requestFromLabel.TextAlign = System.Drawing.
ContentAlignment
.MiddleLeft;
System.Drawing (1)
System.Drawing.cs (1)
17
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
ContentAlignment
))]
System.Windows.Forms (241)
System\Drawing\Design\UITypeEditor.cs (1)
54
[typeof(
ContentAlignment
)] = $"System.Drawing.Design.ContentAlignmentEditor, {Assemblies.SystemDrawingDesign}",
System\Windows\Forms\Control.cs (16)
10634
protected
ContentAlignment
RtlTranslateAlignment(
ContentAlignment
align)
10676
protected internal
ContentAlignment
RtlTranslateContent(
ContentAlignment
align)
10684
case
ContentAlignment
.TopLeft:
10685
return
ContentAlignment
.TopRight;
10686
case
ContentAlignment
.TopRight:
10687
return
ContentAlignment
.TopLeft;
10695
case
ContentAlignment
.MiddleLeft:
10696
return
ContentAlignment
.MiddleRight;
10697
case
ContentAlignment
.MiddleRight:
10698
return
ContentAlignment
.MiddleLeft;
10706
case
ContentAlignment
.BottomLeft:
10707
return
ContentAlignment
.BottomRight;
10708
case
ContentAlignment
.BottomRight:
10709
return
ContentAlignment
.BottomLeft;
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (9)
21
private
ContentAlignment
_imageAlign =
ContentAlignment
.MiddleCenter;
22
private
ContentAlignment
_textAlign =
ContentAlignment
.MiddleCenter;
280
ContentAlignment
align = RtlTranslateContent(TextAlign);
475
[DefaultValue(
ContentAlignment
.MiddleCenter)]
479
public
ContentAlignment
ImageAlign
728
[DefaultValue(
ContentAlignment
.MiddleCenter)]
732
public virtual
ContentAlignment
TextAlign
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (4)
579
ContentAlignment
textAlign,
595
CheckAlign =
ContentAlignment
.TopLeft,
596
ImageAlign =
ContentAlignment
.MiddleCenter,
622
CheckAlign =
ContentAlignment
.TopLeft,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (30)
35
public
ContentAlignment
CheckAlign { get; set; }
36
public
ContentAlignment
ImageAlign { get; set; }
37
public
ContentAlignment
TextAlign { get; set; }
181
CheckAlign ==
ContentAlignment
.MiddleCenter || !LayoutUtils.IsHorizontalAlignment(CheckAlign);
243
action[s_combineCheck] = CheckAlign ==
ContentAlignment
.MiddleCenter || !LayoutUtils.IsVerticalAlignment(CheckAlign);
326
internal
ContentAlignment
RtlTranslateContent(
ContentAlignment
align)
330
ContentAlignment
[][] mapping =
332
[
ContentAlignment
.TopLeft,
ContentAlignment
.TopRight],
333
[
ContentAlignment
.MiddleLeft,
ContentAlignment
.MiddleRight],
334
[
ContentAlignment
.BottomLeft,
ContentAlignment
.BottomRight],
361
ContentAlignment
align = RtlTranslateContent(CheckAlign);
396
case
ContentAlignment
.TopLeft:
397
case
ContentAlignment
.MiddleLeft:
398
case
ContentAlignment
.BottomLeft:
408
case
ContentAlignment
.TopRight:
409
case
ContentAlignment
.MiddleRight:
410
case
ContentAlignment
.BottomRight:
419
case
ContentAlignment
.TopCenter:
430
case
ContentAlignment
.BottomCenter:
440
case
ContentAlignment
.MiddleCenter:
451
/// For example, <see cref="
ContentAlignment
.TopLeft"/> maps to <see cref="TextImageRelation.ImageAboveText"/>
469
private static TextImageRelation ImageAlignToRelation(
ContentAlignment
alignment)
472
private static TextImageRelation TextAlignToRelation(
ContentAlignment
alignment)
478
ContentAlignment
imageAlign = RtlTranslateContent(ImageAlign);
479
ContentAlignment
textAlign = RtlTranslateContent(TextAlign);
515
Rectangle combinedBounds = LayoutUtils.Align(combinedSize, maxCombinedBounds,
ContentAlignment
.MiddleCenter);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (1)
300
ContentAlignment
textAlign,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (1)
157
ContentAlignment
textAlign,
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
138
ContentAlignment
textAlign,
System\Windows\Forms\Controls\Buttons\CheckBox.cs (12)
26
private const
ContentAlignment
AnyRight =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
28
private
ContentAlignment
_checkAlign =
ContentAlignment
.MiddleLeft;
49
TextAlign =
ContentAlignment
.MiddleLeft;
132
[DefaultValue(
ContentAlignment
.MiddleLeft)]
134
public
ContentAlignment
CheckAlign
259
ContentAlignment
align = RtlTranslateContent(CheckAlign);
353
[DefaultValue(
ContentAlignment
.MiddleLeft)]
354
public override
ContentAlignment
TextAlign
System\Windows\Forms\Controls\Buttons\RadioButton.cs (12)
27
private const
ContentAlignment
AnyRight =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
33
private
ContentAlignment
_checkAlign =
ContentAlignment
.MiddleLeft;
48
TextAlign =
ContentAlignment
.MiddleLeft;
123
[DefaultValue(
ContentAlignment
.MiddleLeft)]
125
public
ContentAlignment
CheckAlign
224
ContentAlignment
align = RtlTranslateContent(CheckAlign);
320
[DefaultValue(
ContentAlignment
.MiddleLeft)]
321
public override
ContentAlignment
TextAlign
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (11)
20
internal static
ContentAlignment
ComputeDrawingContentAlignmentForCellStyleAlignment(DataGridViewContentAlignment alignment) =>
24
DataGridViewContentAlignment.TopLeft =>
ContentAlignment
.TopLeft,
25
DataGridViewContentAlignment.TopCenter =>
ContentAlignment
.TopCenter,
26
DataGridViewContentAlignment.TopRight =>
ContentAlignment
.TopRight,
27
DataGridViewContentAlignment.MiddleLeft =>
ContentAlignment
.MiddleLeft,
28
DataGridViewContentAlignment.MiddleCenter =>
ContentAlignment
.MiddleCenter,
29
DataGridViewContentAlignment.MiddleRight =>
ContentAlignment
.MiddleRight,
30
DataGridViewContentAlignment.BottomLeft =>
ContentAlignment
.BottomLeft,
31
DataGridViewContentAlignment.BottomCenter =>
ContentAlignment
.BottomCenter,
32
DataGridViewContentAlignment.BottomRight =>
ContentAlignment
.BottomRight,
33
_ =>
ContentAlignment
.MiddleCenter,
System\Windows\Forms\Controls\Labels\Label.cs (21)
267
case
ContentAlignment
.TopLeft:
268
case
ContentAlignment
.MiddleLeft:
269
case
ContentAlignment
.BottomLeft:
272
case
ContentAlignment
.TopRight:
273
case
ContentAlignment
.MiddleRight:
274
case
ContentAlignment
.BottomRight:
277
case
ContentAlignment
.TopCenter:
278
case
ContentAlignment
.MiddleCenter:
279
case
ContentAlignment
.BottomCenter:
544
[DefaultValue(
ContentAlignment
.MiddleCenter)]
548
public
ContentAlignment
ImageAlign
550
get => Properties.GetValueOrDefault(s_propImageAlign,
ContentAlignment
.MiddleCenter);
557
Properties.AddOrRemoveValue(s_propImageAlign, value, defaultValue:
ContentAlignment
.MiddleCenter);
690
[DefaultValue(
ContentAlignment
.TopLeft)]
692
public virtual
ContentAlignment
TextAlign
694
get => Properties.GetValueOrDefault(s_propTextAlign,
ContentAlignment
.TopLeft);
701
Properties.AddOrRemoveValue(s_propTextAlign, value, defaultValue:
ContentAlignment
.TopLeft);
871
protected Rectangle CalcImageRenderBounds(Image image, Rectangle r,
ContentAlignment
align)
964
private void DrawImage(PaintEventArgs e, Image image, Rectangle r,
ContentAlignment
align)
980
protected void DrawImage(Graphics g, Image image, Rectangle r,
ContentAlignment
align)
983
private void DrawImageInternal(Graphics g, Image image, Rectangle r,
ContentAlignment
align)
System\Windows\Forms\Controls\Labels\LinkLabel.cs (1)
372
internal static Rectangle CalcTextRenderBounds(Rectangle textRect, Rectangle clientRect,
ContentAlignment
align)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridErrorDialog.cs (1)
147
ImageAlign =
ContentAlignment
.MiddleLeft,
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (6)
18
private
ContentAlignment
_controlAlign =
ContentAlignment
.MiddleCenter;
99
[DefaultValue(
ContentAlignment
.MiddleCenter)]
101
public
ContentAlignment
ControlAlign
259
public new
ContentAlignment
ImageAlign
411
public new
ContentAlignment
TextAlign
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (5)
364
_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, maxCheckSize.Width, _maxItemSize.Height),
ContentAlignment
.MiddleCenter);
369
_imageRectangle = LayoutUtils.Align(maxImageSize, new Rectangle(nextPoint.X, nextPoint.Y, maxImageSize.Width, _maxItemSize.Height),
ContentAlignment
.MiddleCenter);
380
_checkRectangle = LayoutUtils.Align(maxCheckSize, new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth, _maxItemSize.Height),
ContentAlignment
.MiddleCenter);
399
_checkRectangle = LayoutUtils.Align(LayoutUtils.UnionSizes(maxCheckSize, maxImageSize), new Rectangle(nextPoint.X, nextPoint.Y, checkAndImageMarginWidth - 1, _maxItemSize.Height),
ContentAlignment
.MiddleCenter);
456
_textRectangle.Y = LayoutUtils.VAlign(_textRectangle.Size, new Rectangle(Point.Empty, _maxItemSize),
ContentAlignment
.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (8)
36
private
ContentAlignment
_imageAlign =
ContentAlignment
.MiddleCenter;
37
private
ContentAlignment
_textAlign =
ContentAlignment
.MiddleCenter;
1001
[DefaultValue(
ContentAlignment
.MiddleCenter)]
1005
public
ContentAlignment
ImageAlign
1876
[DefaultValue(
ContentAlignment
.MiddleCenter)]
1880
public virtual
ContentAlignment
TextAlign
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemInternalLayout.cs (2)
82
internal static TextFormatFlags ContentAlignmentToTextFormat(
ContentAlignment
alignment, bool rightToLeft)
114
layoutOptions.CheckAlign =
ContentAlignment
.TopLeft;
System\Windows\Forms\Controls\ToolStrips\ToolStripItemTextRenderEventArgs.cs (1)
49
ContentAlignment
textAlign)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (4)
991
renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, Text, InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ?
ContentAlignment
.MiddleRight :
ContentAlignment
.MiddleLeft));
1000
renderer.DrawItemText(new ToolStripItemTextRenderEventArgs(g, this, GetShortcutText(), InternalLayout.TextRectangle, textColor, Font, (rightToLeft) ?
ContentAlignment
.MiddleLeft :
ContentAlignment
.MiddleRight));
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (2)
74
arrowRect.Y = LayoutUtils.VAlign(arrowRect.Size, _ownerItem.ClientBounds,
ContentAlignment
.MiddleCenter).Y;
130
imageRect.Y = LayoutUtils.VAlign(imageRect.Size, _ownerItem.ClientBounds,
ContentAlignment
.MiddleCenter).Y;
System\Windows\Forms\Controls\ToolStrips\ToolStripScrollButton.cs (1)
42
ImageAlign =
ContentAlignment
.MiddleCenter,
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (2)
114
public new
ContentAlignment
ImageAlign
211
public new
ContentAlignment
TextAlign
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
304
button.ImageAlign =
ContentAlignment
.MiddleLeft;
System\Windows\Forms\Internal\WinFormsUtils.cs (24)
13
public const
ContentAlignment
AnyRightAlign =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
14
public const
ContentAlignment
AnyLeftAlign =
ContentAlignment
.TopLeft |
ContentAlignment
.MiddleLeft |
ContentAlignment
.BottomLeft;
15
public const
ContentAlignment
AnyTopAlign =
ContentAlignment
.TopLeft |
ContentAlignment
.TopCenter |
ContentAlignment
.TopRight;
16
public const
ContentAlignment
AnyBottomAlign =
ContentAlignment
.BottomLeft |
ContentAlignment
.BottomCenter |
ContentAlignment
.BottomRight;
17
public const
ContentAlignment
AnyMiddleAlign =
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
18
public const
ContentAlignment
AnyCenterAlign =
ContentAlignment
.TopCenter |
ContentAlignment
.MiddleCenter |
ContentAlignment
.BottomCenter;
System\Windows\Forms\Layout\CommonProperties.cs (2)
26
internal const
ContentAlignment
DefaultAlignment =
ContentAlignment
.TopLeft;
System\Windows\Forms\Layout\LayoutUtils.cs (42)
18
public const
ContentAlignment
AnyTop =
ContentAlignment
.TopLeft |
ContentAlignment
.TopCenter |
ContentAlignment
.TopRight;
19
public const
ContentAlignment
AnyBottom =
ContentAlignment
.BottomLeft |
ContentAlignment
.BottomCenter |
ContentAlignment
.BottomRight;
20
public const
ContentAlignment
AnyLeft =
ContentAlignment
.TopLeft |
ContentAlignment
.MiddleLeft |
ContentAlignment
.BottomLeft;
21
public const
ContentAlignment
AnyRight =
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
22
public const
ContentAlignment
AnyCenter =
ContentAlignment
.TopCenter |
ContentAlignment
.MiddleCenter |
ContentAlignment
.BottomCenter;
23
public const
ContentAlignment
AnyMiddle =
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
72
public static int ContentAlignmentToIndex(
ContentAlignment
alignment)
100
Debug.Assert(result != 0x00 || alignment ==
ContentAlignment
.TopLeft, "Error detected in ContentAlignmentToIndex.");
101
Debug.Assert(result != 0x01 || alignment ==
ContentAlignment
.TopCenter, "Error detected in ContentAlignmentToIndex.");
102
Debug.Assert(result != 0x02 || alignment ==
ContentAlignment
.TopRight, "Error detected in ContentAlignmentToIndex.");
104
Debug.Assert(result != 0x04 || alignment ==
ContentAlignment
.MiddleLeft, "Error detected in ContentAlignmentToIndex.");
105
Debug.Assert(result != 0x05 || alignment ==
ContentAlignment
.MiddleCenter, "Error detected in ContentAlignmentToIndex.");
106
Debug.Assert(result != 0x06 || alignment ==
ContentAlignment
.MiddleRight, "Error detected in ContentAlignmentToIndex.");
108
Debug.Assert(result != 0x08 || alignment ==
ContentAlignment
.BottomLeft, "Error detected in ContentAlignmentToIndex.");
109
Debug.Assert(result != 0x09 || alignment ==
ContentAlignment
.BottomCenter, "Error detected in ContentAlignmentToIndex.");
110
Debug.Assert(result != 0x0A || alignment ==
ContentAlignment
.BottomRight, "Error detected in ContentAlignmentToIndex.");
285
public static Rectangle Align(Size alignThis, Rectangle withinThis,
ContentAlignment
align)
306
private static Rectangle HAlign(Size alignThis, Rectangle withinThis,
ContentAlignment
align)
338
public static Rectangle VAlign(Size alignThis, Rectangle withinThis,
ContentAlignment
align)
465
public static bool IsHorizontalAlignment(
ContentAlignment
align)
476
public static bool IsVerticalAlignment(
ContentAlignment
align)
478
Debug.Assert(align !=
ContentAlignment
.MiddleCenter, "Result is ambiguous with an alignment of MiddleCenter.");
479
return (align & (
ContentAlignment
.TopCenter |
ContentAlignment
.BottomCenter)) != 0;
System\Windows\Forms\Printing\PrintControllerWithStatusDialog.StatusDialog.cs (1)
39
TextAlign =
ContentAlignment
.MiddleCenter,
System\Windows\Forms\Rendering\ControlPaint.cs (19)
57
private const
ContentAlignment
AnyRight
58
=
ContentAlignment
.TopRight |
ContentAlignment
.MiddleRight |
ContentAlignment
.BottomRight;
59
private const
ContentAlignment
AnyBottom
60
=
ContentAlignment
.BottomLeft |
ContentAlignment
.BottomCenter |
ContentAlignment
.BottomRight;
61
private const
ContentAlignment
AnyCenter
62
=
ContentAlignment
.TopCenter |
ContentAlignment
.MiddleCenter |
ContentAlignment
.BottomCenter;
63
private const
ContentAlignment
AnyMiddle
64
=
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
2557
internal static TextFormatFlags ConvertAlignmentToTextFormat(
ContentAlignment
alignment)
2588
ContentAlignment
textAlign,
2642
ContentAlignment
alignment,
System.Windows.Forms.Design (54)
System\ComponentModel\Design\DesignerActionPanel.CheckBoxPropertyLine.cs (2)
21
CheckAlign =
ContentAlignment
.MiddleLeft,
22
TextAlign =
ContentAlignment
.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
26
TextAlign =
ContentAlignment
.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (2)
27
TextAlign =
ContentAlignment
.MiddleLeft,
35
TextAlign =
ContentAlignment
.MiddleLeft,
System\ComponentModel\Design\DesignerActionPanel.TextBoxPropertyLine.cs (2)
28
TextAlign =
ContentAlignment
.MiddleLeft,
37
TextAlign =
ContentAlignment
.TopLeft,
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
24
TextAlign =
ContentAlignment
.MiddleLeft,
System\Drawing\Design\ContentAlignmentEditor.ContentUI.cs (21)
30
private
ContentAlignment
Align
36
return
ContentAlignment
.TopLeft;
40
return
ContentAlignment
.TopCenter;
44
return
ContentAlignment
.TopRight;
48
return
ContentAlignment
.MiddleLeft;
52
return
ContentAlignment
.MiddleCenter;
56
return
ContentAlignment
.MiddleRight;
60
return
ContentAlignment
.BottomLeft;
64
return
ContentAlignment
.BottomCenter;
68
return
ContentAlignment
.BottomRight;
75
case
ContentAlignment
.TopLeft:
78
case
ContentAlignment
.TopCenter:
81
case
ContentAlignment
.TopRight:
84
case
ContentAlignment
.MiddleLeft:
87
case
ContentAlignment
.MiddleCenter:
90
case
ContentAlignment
.MiddleRight:
93
case
ContentAlignment
.BottomLeft:
96
case
ContentAlignment
.BottomCenter:
99
case
ContentAlignment
.BottomRight:
453
=> Align = Value is
ContentAlignment
contentAligment ? contentAligment :
ContentAlignment
.MiddleLeft;
System\Windows\Forms\Design\ButtonBaseDesigner.cs (5)
47
ContentAlignment
alignment =
ContentAlignment
.MiddleCenter;
103
private static int CheckboxBaselineOffset(
ContentAlignment
alignment, FlatStyle flatStyle)
159
private static int RadiobuttonBaselineOffset(
ContentAlignment
alignment, FlatStyle flatStyle)
190
private static int DefaultBaselineOffset(
ContentAlignment
alignment, FlatStyle flatStyle)
System\Windows\Forms\Design\ComboBoxDesigner.cs (1)
33
int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.
ContentAlignment
.TopLeft);
System\Windows\Forms\Design\DateTimePickerDesigner.cs (1)
27
int baseline = DesignerUtils.GetTextBaseline(Control,
ContentAlignment
.MiddleLeft);
System\Windows\Forms\Design\DesignBindingPicker.cs (4)
150
TextAlign =
ContentAlignment
.MiddleLeft,
189
TextAlign =
ContentAlignment
.TopLeft,
277
TextAlign =
ContentAlignment
.MiddleLeft,
321
TextAlign =
ContentAlignment
.TopLeft,
System\Windows\Forms\Design\DesignerUtils.cs (9)
107
public const
ContentAlignment
AnyTopAlignment =
ContentAlignment
.TopLeft |
ContentAlignment
.TopCenter |
ContentAlignment
.TopRight;
108
public const
ContentAlignment
AnyMiddleAlignment =
ContentAlignment
.MiddleLeft |
ContentAlignment
.MiddleCenter |
ContentAlignment
.MiddleRight;
524
public static unsafe int GetTextBaseline(Control ctrl,
ContentAlignment
alignment)
System\Windows\Forms\Design\LabelDesigner.cs (3)
31
ContentAlignment
alignment =
ContentAlignment
.TopLeft;
97
private static int LabelBaselineOffset(
ContentAlignment
alignment, BorderStyle borderStyle)
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (1)
29
int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.
ContentAlignment
.TopLeft);
System\Windows\Forms\Design\UpDownBaseDesigner.cs (1)
43
int baseline = DesignerUtils.GetTextBaseline(Control, Drawing.
ContentAlignment
.TopLeft);
System.Windows.Forms.Design.Tests (17)
EnsureEditorsTests.cs (1)
51
[InlineData(typeof(
ContentAlignment
), typeof(ContentAlignmentEditor))]
System\Windows\Forms\Design\DesignerUtilsTests.cs (14)
551
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.TopLeft, 14)]
552
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.TopCenter, 14)]
553
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.TopRight, 14)]
554
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.MiddleLeft, 31)]
555
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.MiddleCenter, 31)]
556
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.MiddleRight, 31)]
557
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.BottomLeft, 48)]
558
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.BottomCenter, 48)]
559
[InlineData(100, 50, "Arial", 10,
ContentAlignment
.BottomRight, 48)]
560
[InlineData(200, 100, "Times New Roman", 12,
ContentAlignment
.TopLeft, 16)]
561
[InlineData(200, 100, "Times New Roman", 12,
ContentAlignment
.MiddleCenter, 57)]
562
[InlineData(200, 100, "Times New Roman", 12,
ContentAlignment
.BottomRight, 97)]
564
int width, int height, string fontFamily, float fontSize,
ContentAlignment
alignment, int expectedBaseline)
581
Action action = () => DesignerUtils.GetTextBaseline(null!,
ContentAlignment
.TopLeft);
System\Windows\Forms\Design\TextBoxBaseDesignerTests.cs (1)
59
int expectedBaseline = DesignerUtils.GetTextBaseline(_textbox, Drawing.
ContentAlignment
.TopLeft) + expectedBaselineOffset;
System\Windows\Forms\Design\UpDownBaseDesignerTests.cs (1)
58
int expectedBaseline = DesignerUtils.GetTextBaseline(_numericUpDown, Drawing.
ContentAlignment
.TopLeft) + expectedBaselineOffset;
System.Windows.Forms.Tests (365)
System\Windows\Forms\ButtonBaseTests.cs (66)
76
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
113
Assert.Equal(
ContentAlignment
.MiddleCenter, control.TextAlign);
184
foreach (
ContentAlignment
textAlign in Enum.GetValues(typeof(
ContentAlignment
)))
192
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomLeft, 0x56012A00, 0x6000 };
193
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomCenter, 0x56012B00, 0x6000 };
194
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomRight, 0x56012900, 0x6000 };
195
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleLeft, 0x56012E00, 0x6000 };
196
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleCenter, 0x56012F00, 0x6000 };
197
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleRight, 0x56012D00, 0x6000 };
198
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopLeft, 0x56012600, 0x6000 };
199
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopCenter, 0x56012700, 0x6000 };
200
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopRight, 0x56012500, 0x6000 };
202
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
203
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
204
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
205
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
206
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
207
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
208
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopLeft, 0x56012500, 0 };
209
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopCenter, 0x56012700, 0 };
210
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopRight, 0x56012600, 0 };
212
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
213
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
214
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
215
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
216
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
217
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
218
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopLeft, 0x56012500, 0 };
219
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopCenter, 0x56012700, 0 };
220
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopRight, 0x56012600, 0 };
225
public void ButtonBase_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft,
ContentAlignment
textAlign, int expectedStyle, int expectedExStyle)
1843
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1852
public void ButtonBase_ImageAlign_Set_GetReturnsExpected(bool autoSize,
ContentAlignment
value)
1875
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1877
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
1885
public void ButtonBase_ImageAlign_SetWithParent_GetReturnsExpected(bool autoSize,
ContentAlignment
value, int expectedParentLayoutCallCount)
1933
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1935
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
1943
public void ButtonBase_ImageAlign_SetWithHandle_GetReturnsExpected(bool autoSize,
ContentAlignment
value, int expectedInvalidatedCallCount)
1979
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
1981
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
1989
public void ButtonBase_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize,
ContentAlignment
value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount)
2048
[InvalidEnumData<
ContentAlignment
>]
2049
public void ButtonBase_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
3268
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3278
public void ButtonBase_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value)
3304
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3306
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
3315
public void ButtonBase_TextAlign_SetWithParent_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedParentLayoutCallCount)
3364
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3366
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
3377
public void ButtonBase_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount)
3414
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
3416
int expectedCallCount = value ==
ContentAlignment
.MiddleCenter ? 0 : 1;
3431
public void ButtonBase_TextAlign_SetWithParentWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount)
3491
[InvalidEnumData<
ContentAlignment
>]
3492
public void ButtonBase_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ButtonFlatAdapterTests.cs (4)
167
ContentAlignment
textAlign =
ContentAlignment
.TopLeft;
215
ContentAlignment
textAlign =
ContentAlignment
.TopLeft;
System\Windows\Forms\ButtonPopupAdapterTests.cs (4)
92
ContentAlignment
textAlign =
ContentAlignment
.MiddleCenter;
125
ContentAlignment
textAlign =
ContentAlignment
.TopLeft;
System\Windows\Forms\ButtonTests.cs (32)
79
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
111
Assert.Equal(
ContentAlignment
.MiddleCenter, control.TextAlign);
206
foreach (
ContentAlignment
textAlign in Enum.GetValues(typeof(
ContentAlignment
)))
214
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomLeft, 0x56012A00, 0x6000 };
215
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomCenter, 0x56012B00, 0x6000 };
216
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.BottomRight, 0x56012900, 0x6000 };
217
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleLeft, 0x56012E00, 0x6000 };
218
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleCenter, 0x56012F00, 0x6000 };
219
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.MiddleRight, 0x56012D00, 0x6000 };
220
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopLeft, 0x56012600, 0x6000 };
221
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopCenter, 0x56012700, 0x6000 };
222
yield return new object[] { FlatStyle.System, RightToLeft.Yes,
ContentAlignment
.TopRight, 0x56012500, 0x6000 };
224
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
225
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
226
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
227
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
228
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
229
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
230
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopLeft, 0x56012500, 0 };
231
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopCenter, 0x56012700, 0 };
232
yield return new object[] { FlatStyle.System, RightToLeft.No,
ContentAlignment
.TopRight, 0x56012600, 0 };
234
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomLeft, 0x56012900, 0 };
235
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomCenter, 0x56012B00, 0 };
236
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.BottomRight, 0x56012A00, 0 };
237
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleLeft, 0x56012D00, 0 };
238
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleCenter, 0x56012F00, 0 };
239
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.MiddleRight, 0x56012E00, 0 };
240
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopLeft, 0x56012500, 0 };
241
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopCenter, 0x56012700, 0 };
242
yield return new object[] { FlatStyle.System, RightToLeft.Inherit,
ContentAlignment
.TopRight, 0x56012600, 0 };
247
public void Button_CreateParams_GetTextAlign_ReturnsExpected(FlatStyle flatStyle, RightToLeft rightToLeft,
ContentAlignment
textAlign, int expectedStyle, int expectedExStyle)
System\Windows\Forms\CheckBoxPopupAdapterTests.cs (3)
93
[InlineData(true, 11, 50, 20, 2, false, "First Test", true,
ContentAlignment
.MiddleLeft, RightToLeft.No)]
94
[InlineData(false, 15, 100, 40, 4, true, "Sec Test", false,
ContentAlignment
.TopRight, RightToLeft.Yes)]
104
ContentAlignment
textAlign,
System\Windows\Forms\CheckBoxTests.cs (11)
44
Assert.Equal(
ContentAlignment
.MiddleLeft, control.CheckAlign);
80
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
113
Assert.Equal(
ContentAlignment
.MiddleLeft, control.TextAlign);
186
[EnumData<
ContentAlignment
>]
187
public void CheckBox_CheckAlign_Set_GetReturnsExpected(
ContentAlignment
value)
203
[InvalidEnumData<
ContentAlignment
>]
204
public void CheckBox_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
423
[EnumData<
ContentAlignment
>]
424
public void CheckBox_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
440
[InvalidEnumData<
ContentAlignment
>]
441
public void CheckBox_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ControlTests.cs (4)
1418
public new
ContentAlignment
RtlTranslateAlignment(
ContentAlignment
align) => base.RtlTranslateAlignment(align);
1420
public new
ContentAlignment
RtlTranslateContent(
ContentAlignment
align) => base.RtlTranslateContent(align);
System\Windows\Forms\ControlTests.Methods.cs (24)
6828
public void Control_RtlTranslateAlignment_InvokeContentAlignment_ReturnsExpected(RightToLeft rightToLeft,
ContentAlignment
align,
ContentAlignment
expected)
6876
foreach (
ContentAlignment
align in Enum.GetValues(typeof(
ContentAlignment
)))
6882
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.BottomCenter,
ContentAlignment
.BottomCenter };
6883
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.BottomLeft,
ContentAlignment
.BottomRight };
6884
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.BottomRight,
ContentAlignment
.BottomLeft };
6885
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.MiddleCenter,
ContentAlignment
.MiddleCenter };
6886
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.MiddleLeft,
ContentAlignment
.MiddleRight };
6887
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.MiddleRight,
ContentAlignment
.MiddleLeft };
6888
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.TopCenter,
ContentAlignment
.TopCenter };
6889
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.TopLeft,
ContentAlignment
.TopRight };
6890
yield return new object[] { RightToLeft.Yes,
ContentAlignment
.TopRight,
ContentAlignment
.TopLeft };
6895
public void Control_RtlTranslateContent_Invoke_ReturnsExpected(RightToLeft rightToLeft,
ContentAlignment
align,
ContentAlignment
expected)
System\Windows\Forms\LabelTests.cs (23)
72
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
107
Assert.Equal(
ContentAlignment
.TopLeft, control.TextAlign);
244
[InvalidEnumData<
ContentAlignment
>]
245
public void Label_ImageAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
255
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
264
public void Label_ImageAlign_Set_GetReturnsExpected(bool autoSize,
ContentAlignment
value)
383
[InlineData(
ContentAlignment
.TopLeft)]
384
[InlineData(
ContentAlignment
.TopCenter)]
385
[InlineData(
ContentAlignment
.TopRight)]
386
[InlineData(
ContentAlignment
.MiddleLeft)]
387
[InlineData(
ContentAlignment
.MiddleCenter)]
388
[InlineData(
ContentAlignment
.MiddleRight)]
389
[InlineData(
ContentAlignment
.BottomLeft)]
390
[InlineData(
ContentAlignment
.BottomCenter)]
391
[InlineData(
ContentAlignment
.BottomRight)]
392
public void Label_TextAlign_Set_GetReturnsExpected(
ContentAlignment
alignment)
405
label.TextAlign =
ContentAlignment
.TopLeft;
410
label.TextAlign =
ContentAlignment
.TopLeft;
418
label.TextAlign =
ContentAlignment
.TopLeft;
423
label.TextAlign =
ContentAlignment
.MiddleCenter;
840
label.TextAlign =
ContentAlignment
.BottomCenter;
844
label.TextAlign =
ContentAlignment
.BottomLeft;
System\Windows\Forms\RadioButtonBaseAdapterTests.cs (2)
309
radioButton.CheckAlign =
ContentAlignment
.BottomRight;
312
layoutOptions.CheckAlign.Should().Be(
ContentAlignment
.BottomRight);
System\Windows\Forms\RadioButtonTests.cs (25)
44
Assert.Equal(
ContentAlignment
.MiddleLeft, control.CheckAlign);
79
Assert.Equal(
ContentAlignment
.MiddleCenter, control.ImageAlign);
111
Assert.Equal(
ContentAlignment
.MiddleLeft, control.TextAlign);
170
[InvalidEnumData<
ContentAlignment
>]
171
public void RadioButton_CheckAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
177
public static TheoryData<
ContentAlignment
> CheckAlignData =>
179
ContentAlignment
.TopLeft,
180
ContentAlignment
.TopRight,
181
ContentAlignment
.BottomCenter,
182
ContentAlignment
.BottomLeft,
183
ContentAlignment
.BottomRight,
184
ContentAlignment
.MiddleLeft,
185
ContentAlignment
.MiddleRight,
186
ContentAlignment
.TopCenter,
187
ContentAlignment
.MiddleCenter
192
public void RadioButton_CheckAlign_Set_GetReturnsExpected(
ContentAlignment
value)
306
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
316
public void RadioRadioButton_TextAlign_Set_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value)
342
foreach (
ContentAlignment
value in Enum.GetValues(typeof(
ContentAlignment
)))
344
int expectedCallCount = value ==
ContentAlignment
.MiddleLeft ? 0 : 1;
355
public void RadioRadioButton_TextAlign_SetWithHandle_GetReturnsExpected(bool autoSize, FlatStyle flatStyle,
ContentAlignment
value, int expectedInvalidatedCallCount, int expectedStyleChangedCallCount)
391
[InvalidEnumData<
ContentAlignment
>]
392
public void RadioRadioButton_TextAlign_SetInvalidValue_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ToolStripButtonTests.cs (44)
62
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
88
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
143
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
169
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
230
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
256
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
320
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
346
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
408
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
434
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
506
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
532
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
1227
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.None, 0, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1228
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Image, 1, 0, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1229
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.ImageAndText, 1, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1231
yield return new object[] {
ContentAlignment
.TopLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1232
yield return new object[] {
ContentAlignment
.TopLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1233
yield return new object[] {
ContentAlignment
.TopLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1234
yield return new object[] {
ContentAlignment
.TopCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1235
yield return new object[] {
ContentAlignment
.TopCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1236
yield return new object[] {
ContentAlignment
.TopCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1237
yield return new object[] {
ContentAlignment
.TopRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1238
yield return new object[] {
ContentAlignment
.TopRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1239
yield return new object[] {
ContentAlignment
.TopRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
1241
yield return new object[] {
ContentAlignment
.MiddleLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1242
yield return new object[] {
ContentAlignment
.MiddleLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1243
yield return new object[] {
ContentAlignment
.MiddleLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1244
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1245
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1246
yield return new object[] {
ContentAlignment
.MiddleCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1247
yield return new object[] {
ContentAlignment
.MiddleRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1248
yield return new object[] {
ContentAlignment
.MiddleRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1249
yield return new object[] {
ContentAlignment
.MiddleRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
1251
yield return new object[] {
ContentAlignment
.BottomLeft, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1252
yield return new object[] {
ContentAlignment
.BottomLeft, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1253
yield return new object[] {
ContentAlignment
.BottomLeft, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Left | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1254
yield return new object[] {
ContentAlignment
.BottomCenter, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1255
yield return new object[] {
ContentAlignment
.BottomCenter, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1256
yield return new object[] {
ContentAlignment
.BottomCenter, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.HorizontalCenter | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1257
yield return new object[] {
ContentAlignment
.BottomRight, RightToLeft.Yes, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix | TextFormatFlags.RightToLeft };
1258
yield return new object[] {
ContentAlignment
.BottomRight, RightToLeft.Inherit, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1259
yield return new object[] {
ContentAlignment
.BottomRight, RightToLeft.No, ToolStripItemDisplayStyle.Text, 0, 1, TextFormatFlags.Right | TextFormatFlags.Bottom | TextFormatFlags.HidePrefix };
1264
public void ToolStripButton_OnPaint_InvokeWithOwner_DoesNotCallPaint(
ContentAlignment
textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat)
1355
public void ToolStripButton_OnPaint_InvokeWithOwnerCantShowKeyboardCues_DoesNotCallPaint(
ContentAlignment
textAlign, RightToLeft rightToLeft, ToolStripItemDisplayStyle displayStyle, int expectedRenderItemImageCallCount, int expectedRenderItemTextCallCount, TextFormatFlags expectedTextFormat)
System\Windows\Forms\ToolStripControlHostTests.cs (25)
72
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ControlAlign);
91
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
117
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
697
[EnumData<
ContentAlignment
>]
698
public void ToolStripControlHost_ControlAlign_Set_GetReturnsExpected(
ContentAlignment
value)
722
[EnumData<
ContentAlignment
>]
723
public void ToolStripControlHost_ControlAlign_SetDisposed_GetReturnsExpected(
ContentAlignment
value)
740
[InvalidEnumData<
ContentAlignment
>]
741
[InlineData((
ContentAlignment
)int.MaxValue)]
742
[InlineData((
ContentAlignment
)int.MinValue)]
743
public void ToolStripControlHost_ControlAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
1241
[EnumData<
ContentAlignment
>]
1242
public void ToolStripControlHost_ImageAlign_Set_GetReturnsExpected(
ContentAlignment
value)
1259
[InvalidEnumData<
ContentAlignment
>]
1260
[InlineData((
ContentAlignment
)int.MaxValue)]
1261
[InlineData((
ContentAlignment
)int.MinValue)]
1262
public void ToolStripControlHost_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
2304
[EnumData<
ContentAlignment
>]
2305
public void ToolStripControlHost_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
2320
[InvalidEnumData<
ContentAlignment
>]
2321
[InlineData((
ContentAlignment
)int.MaxValue)]
2322
[InlineData((
ContentAlignment
)int.MinValue)]
2323
public void ToolStripControlHost_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
2767
[EnumData<
ContentAlignment
>]
2768
public void ToolStripControlHost_OnBoundsChanged_Invoke_Success(
ContentAlignment
controlAlign)
System\Windows\Forms\ToolStripDropDownItemTests.cs (8)
62
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
88
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
151
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
177
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
250
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
276
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
358
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
384
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
System\Windows\Forms\ToolStripItemTests.cs (66)
61
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
87
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
146
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
172
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
241
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
267
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
4173
[EnumData<
ContentAlignment
>]
4174
public void ToolStripItem_ImageAlign_Set_GetReturnsExpected(
ContentAlignment
value)
4188
[InlineData(
ContentAlignment
.TopLeft, 1)]
4189
[InlineData(
ContentAlignment
.TopCenter, 1)]
4190
[InlineData(
ContentAlignment
.TopRight, 1)]
4191
[InlineData(
ContentAlignment
.MiddleLeft, 1)]
4192
[InlineData(
ContentAlignment
.MiddleCenter, 0)]
4193
[InlineData(
ContentAlignment
.MiddleRight, 1)]
4194
[InlineData(
ContentAlignment
.BottomLeft, 1)]
4195
[InlineData(
ContentAlignment
.BottomCenter, 1)]
4196
[InlineData(
ContentAlignment
.BottomRight, 1)]
4197
public void ToolStripItem_ImageAlign_SetWithOwner_GetReturnsExpected(
ContentAlignment
value, int expectedParentLayoutCallCount)
4235
[InlineData(
ContentAlignment
.TopLeft, 1)]
4236
[InlineData(
ContentAlignment
.TopCenter, 1)]
4237
[InlineData(
ContentAlignment
.TopRight, 1)]
4238
[InlineData(
ContentAlignment
.MiddleLeft, 1)]
4239
[InlineData(
ContentAlignment
.MiddleCenter, 0)]
4240
[InlineData(
ContentAlignment
.MiddleRight, 1)]
4241
[InlineData(
ContentAlignment
.BottomLeft, 1)]
4242
[InlineData(
ContentAlignment
.BottomCenter, 1)]
4243
[InlineData(
ContentAlignment
.BottomRight, 1)]
4244
public void ToolStripItem_ImageAlign_SetWithOwnerWithHandle_GetReturnsExpected(
ContentAlignment
value, int expectedParentLayoutCallCount)
4295
[EnumData<
ContentAlignment
>]
4296
public void ToolStripItem_ImageAlign_SetWithParent_GetReturnsExpected(
ContentAlignment
value)
4327
[EnumData<
ContentAlignment
>]
4328
public void ToolStripItem_ImageAlign_SetWithParentWithHandle_GetReturnsExpected(
ContentAlignment
value)
4372
[InvalidEnumData<
ContentAlignment
>]
4373
[InlineData((
ContentAlignment
)int.MaxValue)]
4374
[InlineData((
ContentAlignment
)int.MinValue)]
4375
public void ToolStripItem_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
8289
[EnumData<
ContentAlignment
>]
8290
public void ToolStripItem_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
8304
[InlineData(
ContentAlignment
.TopLeft, 1)]
8305
[InlineData(
ContentAlignment
.TopCenter, 1)]
8306
[InlineData(
ContentAlignment
.TopRight, 1)]
8307
[InlineData(
ContentAlignment
.MiddleLeft, 1)]
8308
[InlineData(
ContentAlignment
.MiddleCenter, 0)]
8309
[InlineData(
ContentAlignment
.MiddleRight, 1)]
8310
[InlineData(
ContentAlignment
.BottomLeft, 1)]
8311
[InlineData(
ContentAlignment
.BottomCenter, 1)]
8312
[InlineData(
ContentAlignment
.BottomRight, 1)]
8313
public void ToolStripItem_TextAlign_SetWithOwner_GetReturnsExpected(
ContentAlignment
value, int expectedParentLayoutCallCount)
8351
[InlineData(
ContentAlignment
.TopLeft, 1)]
8352
[InlineData(
ContentAlignment
.TopCenter, 1)]
8353
[InlineData(
ContentAlignment
.TopRight, 1)]
8354
[InlineData(
ContentAlignment
.MiddleLeft, 1)]
8355
[InlineData(
ContentAlignment
.MiddleCenter, 0)]
8356
[InlineData(
ContentAlignment
.MiddleRight, 1)]
8357
[InlineData(
ContentAlignment
.BottomLeft, 1)]
8358
[InlineData(
ContentAlignment
.BottomCenter, 1)]
8359
[InlineData(
ContentAlignment
.BottomRight, 1)]
8360
public void ToolStripItem_TextAlign_SetWithOwnerWithHandle_GetReturnsExpected(
ContentAlignment
value, int expectedParentLayoutCallCount)
8411
[EnumData<
ContentAlignment
>]
8412
public void ToolStripItem_TextAlign_SetWithParent_GetReturnsExpected(
ContentAlignment
value)
8443
[EnumData<
ContentAlignment
>]
8444
public void ToolStripItem_TextAlign_SetWithParentWithHandle_GetReturnsExpected(
ContentAlignment
value)
8488
[InvalidEnumData<
ContentAlignment
>]
8489
[InlineData((
ContentAlignment
)int.MaxValue)]
8490
[InlineData((
ContentAlignment
)int.MinValue)]
8491
public void ToolStripItem_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
System\Windows\Forms\ToolStripItemTextRenderEventArgsTests.cs (6)
39
yield return new object[] { new ToolStripButton(), null, Rectangle.Empty, Color.Empty, null,
ContentAlignment
.TopLeft - 1, TextFormatFlags.Default | TextFormatFlags.Top | TextFormatFlags.HidePrefix };
40
yield return new object[] { new ToolStripButton(), "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont,
ContentAlignment
.MiddleCenter, TextFormatFlags.Default | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.HidePrefix };
41
yield return new object[] { new ToolStripButton(), "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont,
ContentAlignment
.BottomRight, TextFormatFlags.Default | TextFormatFlags.Bottom | TextFormatFlags.Right | TextFormatFlags.HidePrefix };
42
yield return new object[] { new ToolStripButton() { RightToLeft = RightToLeft.Yes }, "text", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont, (
ContentAlignment
)(-1), TextFormatFlags.Default | TextFormatFlags.Bottom | TextFormatFlags.Right | TextFormatFlags.RightToLeft | TextFormatFlags.HidePrefix };
47
public void Ctor_ToolStripItem_String_Rectangle_Color_Font_ContentAlignment(ToolStripItem item, string text, Rectangle textRectangle, Color textColor, Font textFont,
ContentAlignment
textAlign, TextFormatFlags expectedTextFormat)
69
Assert.Throws<ArgumentNullException>("item", () => new ToolStripItemTextRenderEventArgs(graphics, null, "", new Rectangle(1, 2, 3, 4), Color.Red, SystemFonts.DefaultFont,
ContentAlignment
.TopLeft));
System\Windows\Forms\ToolStripMenuItemTests.cs (4)
62
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
93
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
287
ImageAlign =
ContentAlignment
.BottomCenter,
301
TextAlign =
ContentAlignment
.BottomRight,
System\Windows\Forms\ToolStripSeparatorTests.cs (14)
59
Assert.Equal(
ContentAlignment
.MiddleCenter, item.ImageAlign);
85
Assert.Equal(
ContentAlignment
.MiddleCenter, item.TextAlign);
448
[EnumData<
ContentAlignment
>]
449
public void ToolStripSeparator_ImageAlign_Set_GetReturnsExpected(
ContentAlignment
value)
463
[InvalidEnumData<
ContentAlignment
>]
464
[InlineData((
ContentAlignment
)int.MaxValue)]
465
[InlineData((
ContentAlignment
)int.MinValue)]
466
public void ToolStripSeparator_ImageAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
625
[EnumData<
ContentAlignment
>]
626
public void ToolStripSeparator_TextAlign_Set_GetReturnsExpected(
ContentAlignment
value)
640
[InvalidEnumData<
ContentAlignment
>]
641
[InlineData((
ContentAlignment
)int.MaxValue)]
642
[InlineData((
ContentAlignment
)int.MinValue)]
643
public void ToolStripSeparator_TextAlign_SetInvalid_ThrowsInvalidEnumArgumentException(
ContentAlignment
value)
WinFormsControlsTest (4)
DesignTimeAligned.Designer.cs (3)
50
this.label1.TextAlign = System.Drawing.
ContentAlignment
.MiddleRight;
61
this.label2.TextAlign = System.Drawing.
ContentAlignment
.MiddleRight;
71
this.button1.TextAlign = System.Drawing.
ContentAlignment
.MiddleLeft;
FormOwnerTestForm.cs (1)
50
TextAlign =
ContentAlignment
.MiddleCenter