本文整理汇总了C#中System.Windows.Forms.Padding类的典型用法代码示例。如果您正苦于以下问题:C# Padding类的具体用法?C# Padding怎么用?C# Padding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Padding类属于System.Windows.Forms命名空间,在下文中一共展示了Padding类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:31,代码来源:PaddingSerializer.cs
示例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;
}
开发者ID:xinfushe,项目名称:CSharpGL,代码行数:28,代码来源:FormToon.cs
示例3: DarkTextBox
public DarkTextBox()
{
BackColor = Colors.LightBackground;
ForeColor = Colors.LightText;
Padding = new Padding(2, 2, 2, 2);
BorderStyle = BorderStyle.FixedSingle;
}
开发者ID:ZANEKEVIN,项目名称:DarkUI,代码行数:7,代码来源:DarkTextBox.cs
示例4: BasicControl
public BasicControl()
{
DoubleBuffered = true;
ResizeRedraw = true;
Margin = new Padding(0);
Dock = DockStyle.Fill;
}
开发者ID:JurgenCox,项目名称:compbio-base,代码行数:7,代码来源:BasicControl.cs
示例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);
}
开发者ID:kalashnikovisme,项目名称:idel_app,代码行数:7,代码来源:DisComboBox.cs
示例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();
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:25,代码来源:MarginCommand.cs
示例7: MenuStrip
public MenuStrip()
{
BorderColor = Drawing.Color.Transparent;
Orientation = Forms.Orientation.Horizontal;
Padding = new Padding(2);
Size = new System.Drawing.Size(600, 24);
}
开发者ID:Meragon,项目名称:Unity-WinForms,代码行数:7,代码来源:MenuStrip.cs
示例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);
}
开发者ID:andrepontesmelo,项目名称:imjoias,代码行数:8,代码来源:GráficoCotação.cs
示例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;
}
开发者ID:Mofangbao,项目名称:CSharpGL,代码行数:58,代码来源:FormSimpleUIRect.cs
示例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);
}
开发者ID:mkoscak,项目名称:kv-validator,代码行数:57,代码来源:MyDoubleBufferedGrid.cs
示例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();
}
开发者ID:Mofangbao,项目名称:CSharpGL,代码行数:57,代码来源:FormLegacyTexture3D2.cs
示例12: CreateCheckBox
public static CheckBox CreateCheckBox(string text, Padding margin)
{
return new CheckBox
{
Anchor = AnchorStyles.Left,
AutoSize = true,
Margin = margin,
Text = text
};
}
开发者ID:Boddlnagg,项目名称:VisualRust,代码行数:10,代码来源:Utils.cs
示例13: CreateLabel
public static Label CreateLabel(string text, Padding margin)
{
return new Label
{
Anchor = AnchorStyles.Left,
AutoSize = true,
Margin = margin,
Text = text
};
}
开发者ID:Boddlnagg,项目名称:VisualRust,代码行数:10,代码来源:Utils.cs
示例14: CreateRadioButton
public static RadioButton CreateRadioButton(string text, Padding margin)
{
return new RadioButton
{
AutoSize = true,
Anchor = AnchorStyles.Left,
Text = text,
Margin = margin
};
}
开发者ID:Boddlnagg,项目名称:VisualRust,代码行数:10,代码来源:Utils.cs
示例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;
}
开发者ID:Mofangbao,项目名称:CSharpGL,代码行数:10,代码来源:IUILayoutParam.cs
示例16: Serialize
public void Serialize()
{
var padding = new Padding(10, 20, 30, 40);
string encodedValue = PaddingSerializer.SerializePadding(padding);
Assert.AreEqual("10,20,30,40", encodedValue);
Padding padding2 = PaddingSerializer.DeserializePadding(encodedValue, Padding.Empty);
Assert.AreEqual(padding, padding2);
}
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:10,代码来源:PaddingSerializerFixture.cs
示例17: PreferencesForm
public PreferencesForm() {
SetStyle(ControlStyles.ContainerControl, false);
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.UserPaint, true);
UpdateStyles();
Padding = new System.Windows.Forms.Padding(0);
InitializeComponent();
}
开发者ID:snowmizuh,项目名称:Shellscape.Common,代码行数:11,代码来源:PreferencesForm.cs
示例18: RoundTrip
public void RoundTrip ()
{
Padding p1 = new Padding (1, 2, 3, 4);
Padding p2 = new Padding (1);
Padding p3 = new Padding ();
Assert.AreEqual (p1, RoundTripPadding (p1), "B1");
Assert.AreEqual (p2, RoundTripPadding (p2), "B2");
Assert.AreEqual (p3, RoundTripPadding (p3), "B3");
}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:PaddingConverterTest.cs
示例19: CreateComboBox
public static ComboBox CreateComboBox(string[] text, Padding margin)
{
var box = new ComboBox
{
Anchor = AnchorStyles.Left,
AutoSize = true,
Margin = margin,
DropDownStyle = ComboBoxStyle.DropDownList
};
box.Items.AddRange(text);
return box;
}
开发者ID:Boddlnagg,项目名称:VisualRust,代码行数:12,代码来源:Utils.cs
示例20: SerializePadding
/// <summary>
/// Serializes the padding.
/// </summary>
/// <param name="padding">The padding.</param>
/// <returns></returns>
public static string SerializePadding(Padding padding)
{
var builder = new StringBuilder();
builder.Append(padding.Left);
builder.Append(PaddingSeperator);
builder.Append(padding.Top);
builder.Append(PaddingSeperator);
builder.Append(padding.Right);
builder.Append(PaddingSeperator);
builder.Append(padding.Bottom);
return builder.ToString();
}
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:18,代码来源:PaddingSerializer.cs
注:本文中的System.Windows.Forms.Padding类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论