本文整理汇总了C#中System.Windows.Forms.LayoutEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LayoutEventArgs类的具体用法?C# LayoutEventArgs怎么用?C# LayoutEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了LayoutEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CGFX_Layout
private void CGFX_Layout(object sender, LayoutEventArgs e)
{
if (ModViewer != null)
{
ModViewer.Render();
}
}
示例2: ValidateForm_Layout
private void ValidateForm_Layout(object sender, LayoutEventArgs e)
{
switch (activeState)
{
case "InputFile":
xslRadioButton.Enabled = false;
break;
case "XsdFile":
xslRadioButton.Enabled = false;
againstXSDRadioButton.Enabled = false;
break;
}
switch (selectedValidationType)
{
case "XSL":
xslRadioButton.Checked = true;
break;
case "XSD":
againstXSDRadioButton.Checked = true;
break;
default:
xmlRadioButton.Checked = true;
selectedValidationType = "Xml";
break;
}
}
示例3: OnLayout
protected override void OnLayout(LayoutEventArgs levent)
{
try
{
DataGridCell currentCell = Grid.CurrentCell;
if (currentCell.ColumnNumber == Cell)
{
DataTable ds = Grid.DataSource as DataTable;
if (ds != null)
{
foreach (string item in Items)
{
if (currentCell.RowNumber < ds.Rows.Count)
{
DataRow row = ds.Rows[currentCell.RowNumber];
string currentValue = (string)row.ItemArray[Cell];
if (currentValue == item)
{
SelectedItem = item;
break;
}
}
}
}
}
base.OnLayout(levent);
}
catch (Exception) {}
}
示例4: InfoForm_Layout
private void InfoForm_Layout(object sender, LayoutEventArgs e)
{
textBoxInfo.Location = new Point(2, 2);
textBoxInfo.Size = new Size(ClientRectangle.Width - 4, ClientRectangle.Height - buttonOK.Size.Height*2);
buttonOK.Location = new Point(ClientRectangle.Width - 100, ClientRectangle.Height - buttonOK.Size.Height*3/2);
}
示例5: VKAuth_Layout
private void VKAuth_Layout(object sender, LayoutEventArgs e)
{
webBrowser1.Url = new System.Uri(
"https://oauth.vk.com/authorize?client_id=5159394&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=friends&response_type=token&v=5.40&scope="
+ Settings.VKscope, System.UriKind.Absolute
);
}
示例6: AddressTextBox_Layout
private void AddressTextBox_Layout(object sender, LayoutEventArgs e)
{
comboBoxHistory.Parent = this.Parent;
comboBoxHistory.Location = this.Location;
comboBoxHistory.Width = this.Width;
comboBoxHistory.DropDownWidth = comboBoxHistory.Width + 15;
}
示例7: MarathonLayout
void MarathonLayout(object sender, LayoutEventArgs e)
{
scorePanel.SetBounds(5, 5, Width - 10, 40);
questionPanel.SetBounds(5, 50, (Width - 10) / 2, Height - 50);
gamePanel.SetBounds((Width / 2)+5, 50, (Width / 2) -10, Height-100);
}
示例8: OnLayout
protected override void OnLayout(LayoutEventArgs e)
{
if ((this.ParentToolStrip != null) && this.ParentToolStrip.IsInDesignMode)
{
if (FlowLayout.GetFlowDirection(this) != FlowDirection.TopDown)
{
FlowLayout.SetFlowDirection(this, FlowDirection.TopDown);
}
if (FlowLayout.GetWrapContents(this))
{
FlowLayout.SetWrapContents(this, false);
}
}
else
{
if (FlowLayout.GetFlowDirection(this) != FlowDirection.LeftToRight)
{
FlowLayout.SetFlowDirection(this, FlowDirection.LeftToRight);
}
if (!FlowLayout.GetWrapContents(this))
{
FlowLayout.SetWrapContents(this, true);
}
}
base.OnLayout(e);
}
示例9: Layout
/// <summary>
/// 布局
/// </summary>
/// <param name="container">容器</param>
/// <param name="layoutEventArgs">Layout事件数据</param>
/// <returns>是否成功 true-是 false-否</returns>
public override bool Layout(object container, LayoutEventArgs layoutEventArgs)
{
Control parent = container as Control;
Rectangle parentClientRectangle = parent.ClientRectangle;
Point nextControlLocation = parentClientRectangle.Location;
int parentWidth = parentClientRectangle.Width;
foreach (Control c in parent.Controls)
{
if (!c.Visible)
{
continue;
}
nextControlLocation.Offset(c.Margin.Left, 0);
c.Location = nextControlLocation;
if (c.Location.X + c.Width * 2 > parentWidth)
{
nextControlLocation.X = parentClientRectangle.X;
nextControlLocation.Y += c.Height;
}
else
{
nextControlLocation.X += c.Width;
}
}
return false;
}
示例10: Form1_Layout
private void Form1_Layout(object sender, LayoutEventArgs e)
{
Rect = ClientRectangle;
Rect.Inflate(-10, -10);
StrSize = string.Format("폭 = {0}, 높이 = {1}", Rect.Width, Rect.Height);
Invalidate();
}
示例11: OnLayout
protected override void OnLayout(LayoutEventArgs e)
{
int offset = AutoScrollPosition.Y;
foreach (Control control in Controls)
{
var size = control.GetPreferredSize(new Size(ClientSize.Width, int.MaxValue));
control.SetBounds(
0,
offset,
ClientSize.Width,
size.Height
);
offset += size.Height;
}
bool vScroll = VScroll;
AdjustFormScrollbars(AutoScroll);
if (vScroll != VScroll)
BeginInvoke(new Action(PerformLayout));
}
示例12: OnLayout
protected override void OnLayout(LayoutEventArgs levent)
{
base.OnLayout(levent);
// calculate the rectangle we will paint within
_controlRectangle = new Rectangle(0, 1, Width, Height - 1);
// calculate the image rectanagle (if we have an image)
_imageRectangle = Rectangle.Empty;
if (_image != null)
{
int IMAGE_TOP_OFFSET = 3;
int IMAGE_LEFT_OFFSET = 2;
_imageRectangle = new Rectangle(IMAGE_LEFT_OFFSET, IMAGE_TOP_OFFSET, _image.Width, _image.Height);
}
//calculate the text rectangle
int TEXT_TOP_OFFSET = 4;
int TEXT_LEFT_MARGIN = 2;
int TEXT_LEFT_OFFSET = _imageRectangle.Right + TEXT_LEFT_MARGIN;
_textRectangle = new Rectangle(TEXT_LEFT_OFFSET, TEXT_TOP_OFFSET, _controlRectangle.Width - TEXT_LEFT_OFFSET, _controlRectangle.Height - TEXT_TOP_OFFSET);
// make sure the control is repainted
Invalidate();
}
示例13: OnLayout
/// <summary>
/// See <see cref="Control.OnLayout"/>
/// </summary>
protected override void OnLayout(LayoutEventArgs e)
{
base.OnLayout(e);
_caption.Width = Width - 2;
Padding = new Padding(1, _caption.Height + 2, 1, 1);
_caption.Top = 1;
}
示例14: SettingsLayout_Layout
private void SettingsLayout_Layout(object sender, LayoutEventArgs e)
{
foreach (UserControl ctrl in SettingsLayout.Controls)
{
ctrl.Width = SettingsLayout.Width - 25;
}
}
示例15: OnLayout
protected override void OnLayout(LayoutEventArgs levent)
{
labelControl.Location = new Point(WIDTH_PADDING, 8);
labelControl.Width = Width - WIDTH_PADDING * 2;
labelControl.Height = Height;
base.OnLayout(levent);
}