300 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 (243)
_generated\1\Validation.cs (2)
72
public static void Validate(System.Drawing.
ContentAlignment
enumToValidate, string parameterName = "value")
83
ReportEnumValidationError(parameterName, intValue, typeof(System.Drawing.
ContentAlignment
));
System\Drawing\Design\UITypeEditor.cs (1)
54
[typeof(
ContentAlignment
)] = $"System.Drawing.Design.ContentAlignmentEditor, {Assemblies.SystemDrawingDesign}",
System\Windows\Forms\Control.cs (16)
10631
protected
ContentAlignment
RtlTranslateAlignment(
ContentAlignment
align)
10673
protected internal
ContentAlignment
RtlTranslateContent(
ContentAlignment
align)
10681
case
ContentAlignment
.TopLeft:
10682
return
ContentAlignment
.TopRight;
10683
case
ContentAlignment
.TopRight:
10684
return
ContentAlignment
.TopLeft;
10692
case
ContentAlignment
.MiddleLeft:
10693
return
ContentAlignment
.MiddleRight;
10694
case
ContentAlignment
.MiddleRight:
10695
return
ContentAlignment
.MiddleLeft;
10703
case
ContentAlignment
.BottomLeft:
10704
return
ContentAlignment
.BottomRight;
10705
case
ContentAlignment
.BottomRight:
10706
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;
134
[DefaultValue(
ContentAlignment
.MiddleLeft)]
136
public
ContentAlignment
CheckAlign
261
ContentAlignment
align = RtlTranslateContent(CheckAlign);
355
[DefaultValue(
ContentAlignment
.MiddleLeft)]
356
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;
125
[DefaultValue(
ContentAlignment
.MiddleLeft)]
127
public
ContentAlignment
CheckAlign
226
ContentAlignment
align = RtlTranslateContent(CheckAlign);
322
[DefaultValue(
ContentAlignment
.MiddleLeft)]
323
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)
47
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);