本文整理汇总了C#中System.Windows.Forms.Padding类的典型用法代码示例。如果您正苦于以下问题:C# Padding类的具体用法?C# Padding怎么用?C# Padding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Padding类属于System.Windows.Forms命名空间,在下文中一共展示了Padding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializePadding
/// <summary>
/// Deserializes the padding.
/// </summary>
/// <param name="encodedValue">The encoded value.</param>
/// <param name="defaultValue">The default value.</param>
/// <returns></returns>
public static Padding DeserializePadding(string encodedValue, Padding defaultValue)
{
if (!string.IsNullOrEmpty(encodedValue))
{
var intValues = new int[4];
string[] values = encodedValue.Split(new[] {PaddingSeperator});
if (values.Length >= 4)
{
for (int i = 0; i < 4; i++)
{
if (!Int32.TryParse(values[i], out intValues[i]))
{
goto returnDefault;
}
}
return new Padding(intValues[0], intValues[1], intValues[2], intValues[3]);
}
}
returnDefault:
return defaultValue;
}
示例2: FormToon
public FormToon()
{
InitializeComponent();
this.camera = new Camera(CameraType.Ortho, this.glCanvas1.Width, this.glCanvas1.Height);
satelliteRoration = new SatelliteRotator(camera);
Padding padding = new System.Windows.Forms.Padding(40, 40, 40, 40);
Size size = new Size(100, 100);
IUILayoutParam param;
param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
uiLeftBottomAxis = new SimpleUIAxis(param);
uiLeftBottomAxis.Initialize();
CreateElement();
this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
this.glCanvas1.KeyPress += glCanvas1_KeyPress;
this.glCanvas1.MouseDown += glCanvas1_MouseDown;
this.glCanvas1.MouseMove += glCanvas1_MouseMove;
this.glCanvas1.MouseUp += glCanvas1_MouseUp;
this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
this.glCanvas1.Resize += glCanvas1_Resize;
Application.Idle += Application_Idle;
}
示例3: DarkTextBox
public DarkTextBox()
{
BackColor = Colors.LightBackground;
ForeColor = Colors.LightText;
Padding = new Padding(2, 2, 2, 2);
BorderStyle = BorderStyle.FixedSingle;
}
示例4: BasicControl
public BasicControl()
{
DoubleBuffered = true;
ResizeRedraw = true;
Margin = new Padding(0);
Dock = DockStyle.Fill;
}
示例5: DisComboBox
public DisComboBox()
{
Click += new EventHandler(DisComboBox_Click);
Leave += new EventHandler(DisComboBox_Leave);
ForeColor = System.Drawing.Color.Gray;
Margin = new Padding(ConstControls.CONTROL_INDENT_SMALL);
}
示例6: MarginCommand
public MarginCommand(CommandManager commandManager)
: base(CommandId.MarginsGroup)
{
RepresentativeString = Res.Get(StringId.SpinnerPixelRepresentativeString);
FormatString = Res.Get(StringId.SpinnerPixelFormatString);
// @RIBBON TODO: Have a way to initialize this.
marginValue = new Padding(Convert.ToInt32(MinMargin));
commandManager.BeginUpdate();
commandLeftMargin = new SpinnerCommand(CommandId.AdjustLeftMargin, MinMargin, MaxMargin, MinMargin, Increment, DecimalPlaces, RepresentativeString, FormatString);
commandManager.Add(commandLeftMargin, commandMargin_ExecuteWithArgs);
commandTopMargin = new SpinnerCommand(CommandId.AdjustTopMargin, MinMargin, MaxMargin, MinMargin, Increment, DecimalPlaces, RepresentativeString, FormatString);
commandManager.Add(commandTopMargin, commandMargin_ExecuteWithArgs);
commandRightMargin = new SpinnerCommand(CommandId.AdjustRightMargin, MinMargin, MaxMargin, MinMargin, Increment, DecimalPlaces, RepresentativeString, FormatString);
commandManager.Add(commandRightMargin, commandMargin_ExecuteWithArgs);
commandBottomMargin = new SpinnerCommand(CommandId.AdjustBottomMargin, MinMargin, MaxMargin, MinMargin, Increment, DecimalPlaces, RepresentativeString, FormatString);
commandManager.Add(commandBottomMargin, commandMargin_ExecuteWithArgs);
commandManager.EndUpdate();
}
示例7: MenuStrip
public MenuStrip()
{
BorderColor = Drawing.Color.Transparent;
Orientation = Forms.Orientation.Horizontal;
Padding = new Padding(2);
Size = new System.Drawing.Size(600, 24);
}
示例8: InitializeComponent
public GráficoCotação()
{
InitializeComponent();
períodoInicial = DateTime.Now.Subtract(new TimeSpan(182, 0, 0, 0));
períodoFinal = DateTime.MaxValue;
Padding = new Padding(0);
}
示例9: FormSimpleUIRect
public FormSimpleUIRect()
{
InitializeComponent();
//if (CameraDictionary.Instance.ContainsKey(this.GetType().Name))
//{
// this.camera = CameraDictionary.Instance[this.GetType().Name];
//}
//else
{
this.camera = new Camera(CameraType.Ortho, this.glCanvas1.Width, this.glCanvas1.Height);
//CameraDictionary.Instance.Add(this.GetType().Name, this.camera);
}
satelliteRoration = new SatelliteRotator(camera);
Padding padding = new System.Windows.Forms.Padding(10, 10, 10, 10);
Size size = new Size(100, 100);
IUILayoutParam param;
param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
uiLeftBottomRect = new SimpleUIRect(param);
legacyLeftBottomRect = new LegacySimpleUIRect(param, new Objects.GLColor(1, 1, 1, 1));
param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Top, padding, size);
uiLeftTopRect = new SimpleUIRect(param);
legacyLeftTopRect = new LegacySimpleUIRect(param, new Objects.GLColor(1, 1, 1, 1));
param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Bottom, padding, size);
uiRightBottomRect = new SimpleUIRect(param);
legacyRightBottomRect = new LegacySimpleUIRect(param, new Objects.GLColor(1, 1, 1, 1));
param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Top, padding, size);
uiRightTopRect = new SimpleUIRect(param);
legacyRightTopRect = new LegacySimpleUIRect(param, new Objects.GLColor(1, 1, 1, 1));
uiLeftBottomRect.Initialize();
uiLeftTopRect.Initialize();
uiRightBottomRect.Initialize();
uiRightTopRect.Initialize();
legacyLeftBottomRect.Initialize();
legacyLeftTopRect.Initialize();
legacyRightBottomRect.Initialize();
legacyRightTopRect.Initialize();
axisElement = new AxisElement();
axisElement.Initialize();
axisElement.BeforeRendering += axisElement_BeforeRendering;
axisElement.AfterRendering += axisElement_AfterRendering;
this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
this.glCanvas1.KeyPress += glCanvas1_KeyPress;
this.glCanvas1.MouseDown += glCanvas1_MouseDown;
this.glCanvas1.MouseMove += glCanvas1_MouseMove;
this.glCanvas1.MouseUp += glCanvas1_MouseUp;
this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
this.glCanvas1.Resize += glCanvas1_Resize;
}
示例10: InitGridStyle
private void InitGridStyle()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
//
// gridData
//
AllowUserToResizeColumns = true;
AllowUserToOrderColumns = true;
AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(250)))), ((int)(((byte)(250)))));
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
BackgroundColor = System.Drawing.Color.White;
BorderStyle = System.Windows.Forms.BorderStyle.None;
ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(245)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(0, 4, 0, 4);
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64)))));
dataGridViewCellStyle3.NullValue = null;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
DefaultCellStyle = dataGridViewCellStyle3;
Dock = System.Windows.Forms.DockStyle.Fill;
EnableHeadersVisualStyles = false;
GridColor = System.Drawing.Color.Gainsboro;
Location = new System.Drawing.Point(1, 50);
Margin = new System.Windows.Forms.Padding(1);
Name = "gridData";
RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(240)))), ((int)(((byte)(245)))));
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
RowHeadersWidth = 30;
RowTemplate.Height = 25;
Size = new System.Drawing.Size(834, 436);
}
示例11: FormLegacyTexture3D2
public FormLegacyTexture3D2()
{
InitializeComponent();
//if (CameraDictionary.Instance.ContainsKey(this.GetType().Name))
//{
// this.camera = CameraDictionary.Instance[this.GetType().Name];
//}
//else
{
this.camera = new Camera(CameraType.Ortho, this.glCanvas1.Width, this.glCanvas1.Height);
//CameraDictionary.Instance.Add(this.GetType().Name, this.camera);
}
satelliteRoration = new SatelliteRotator(camera);
Padding padding = new System.Windows.Forms.Padding(10, 10, 10, 10);
Size size = new Size(100, 100);
//Size size = new Size(5, 5);
IUILayoutParam param;
param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
legacyUIRect = new LegacySimpleUIRect(param, new Objects.GLColor(1, 0, 0, 1));
param = new IUILayoutParam(AnchorStyles.Bottom | AnchorStyles.Right, padding, size);
modernUIRect = new SimpleUIRect(param, new GLColor(0, 1, 1, 1));
param = new IUILayoutParam(AnchorStyles.Left | AnchorStyles.Bottom, padding, size);
leftUIAxis = new SimpleUIAxis(param, new GLColor(1, 1, 1, 1));
param = new IUILayoutParam(AnchorStyles.Right | AnchorStyles.Bottom, padding, size);
rightUIAxis = new SimpleUIAxis(param, new GLColor(1, 1, 1, 1));
legacyUIRect.Initialize();
modernUIRect.Initialize();
leftUIAxis.Initialize();
rightUIAxis.Initialize();
legacyUIRect.BeforeRendering += legacyUIRect_BeforeRendering;
legacyUIRect.AfterRendering += legacyUIRect_AfterRendering;
element = new DemoLegacyGLTexture3D();
element.Initialize();
element.BeforeRendering += element_BeforeRendering;
element.AfterRendering += element_AfterRendering;
this.glCanvas1.MouseWheel += glCanvas1_MouseWheel;
this.glCanvas1.KeyPress += glCanvas1_KeyPress;
this.glCanvas1.MouseDown += glCanvas1_MouseDown;
this.glCanvas1.MouseMove += glCanvas1_MouseMove;
this.glCanvas1.MouseUp += glCanvas1_MouseUp;
this.glCanvas1.OpenGLDraw += glCanvas1_OpenGLDraw;
this.glCanvas1.Resize += glCanvas1_Resize;
UpdateInfo();
}
示例12: CreateCheckBox
public static CheckBox CreateCheckBox(string text, Padding margin)
{
return new CheckBox
{
Anchor = AnchorStyles.Left,
AutoSize = true,
Margin = margin,
Text = text
};
}
示例13: CreateLabel
public static Label CreateLabel(string text, Padding margin)
{
return new Label
{
Anchor = AnchorStyles.Left,
AutoSize = true,
Margin = margin,
Text = text
};
}
示例14: CreateRadioButton
public static RadioButton CreateRadioButton(string text, Padding margin)
{
return new RadioButton
{
AutoSize = true,
Anchor = AnchorStyles.Left,
Text = text,
Margin = margin
};
}
示例15: IUILayoutParam
public IUILayoutParam(AnchorStyles anchorStyle, Padding padding, System.Drawing.Size size,
int zNear = -1000, int zFar = 1000)
{
// TODO: Complete member initialization
this.Anchor = anchorStyle;
this.Margin = padding;
this.Size = size;
this.zNear = zNear;
this.zFar = zFar;
}