本文整理汇总了C#中System.Windows.Forms.FlowLayoutPanel.SetFlowBreak方法的典型用法代码示例。如果您正苦于以下问题:C# FlowLayoutPanel.SetFlowBreak方法的具体用法?C# FlowLayoutPanel.SetFlowBreak怎么用?C# FlowLayoutPanel.SetFlowBreak使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.FlowLayoutPanel
的用法示例。
在下文中一共展示了FlowLayoutPanel.SetFlowBreak方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VwXls
public VwXls() {
InitializeComponent();
{
FlowLayoutPanel flp = flperr = new FlowLayoutPanel();
flp.Hide();
flp.Dock = DockStyle.Fill;
{
PictureBox pb = new PictureBox();
pb.Image = Resources.eventlogError.ToBitmap();
pb.SizeMode = PictureBoxSizeMode.AutoSize;
flp.Controls.Add(pb);
}
{
Label la = laerr1 = new Label();
la.AutoSize = true;
flp.Controls.Add(la);
flp.SetFlowBreak(la, true);
}
{
Label la = laerr2 = new Label();
la.AutoSize = true;
flp.Controls.Add(la);
}
flp.Parent = this;
}
{
TableLayoutPanel p = flpwip = new TableLayoutPanel();
p.Hide();
p.Dock = DockStyle.Fill;
p.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
p.RowStyles.Add(new RowStyle(SizeType.AutoSize));
{
FlowLayoutPanel flp = new FlowLayoutPanel();
flp.Anchor = AnchorStyles.None;
flp.AutoSize = true;
flp.AutoSizeMode = AutoSizeMode.GrowAndShrink;
flp.BackColor = Color.WhiteSmoke;
flp.ForeColor = Color.Black;
{
Label la = lawip = new Label();
la.AutoSize = true;
flp.Controls.Add(la);
flp.SetFlowBreak(la, true);
}
{
ProgressBar pb = new ProgressBar();
pb.Style = ProgressBarStyle.Marquee;
flp.Controls.Add(pb);
}
p.Controls.Add(flp);
flp.Show();
}
p.Parent = this;
}
Sync = SynchronizationContext.Current;
}
示例2: TestExtenderProvider
public void TestExtenderProvider()
{
FlowLayoutPanel p = new FlowLayoutPanel ();
Button b = new Button();
Assert.AreEqual(false, p.GetFlowBreak(b), "B1");
p.SetFlowBreak(b, true);
Assert.AreEqual (true, p.GetFlowBreak (b), "B2");
}
示例3: AddPrinters
private void AddPrinters()
{
SuspendLayout();
int prevTop = 0;
Height = 0;
foreach (Printer printer in printers )
{
FlowLayoutPanel printerPanel = new FlowLayoutPanel();
printerPanel.FlowDirection = FlowDirection.LeftToRight;
printerPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink;
Label lblPrinterName = new Label();
lblPrinterName.Text = printer.Name;
lblPrinterName.AutoSize = true;
printerPanel.SetFlowBreak( lblPrinterName, true );
printerPanel.Controls.Add(lblPrinterName);
int rows = 1;
try
{
InkTank[] tanks = printer.GetTanks(printer.Server, printer.Port, printer.Device);
foreach (InkTank tank in tanks)
{
addTank(printerPanel, tank);
}
rows += tanks.Count();
}
catch (Exception e)
{
Label error = new Label();
error.AutoSize = true;
error.Text = e.Message;
printerPanel.Controls.Add(error);
rows += 2 ;
}
printerPanel.Top = prevTop;
printerPanel.Width = this.Width;
printerPanel.Height = 20 * rows;
Height = rows * 20;
Controls.Add(printerPanel);
prevTop = printerPanel.Bottom + 1;
}
ResumeLayout();
}
示例4: TopDownLayoutTest18
public void TopDownLayoutTest18 ()
{
// SetFlowBreak has no effect when WrapContents = false
FlowLayoutPanel p = new FlowLayoutPanel ();
p.Size = new Size (100, 200);
p.WrapContents = false;
p.FlowDirection = FlowDirection.TopDown;
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.SetFlowBreak (p.Controls[0], true);
Assert.AreEqual (new Rectangle (0, 0, 100, 100), p.Controls[0].Bounds, "BT1");
Assert.AreEqual (new Rectangle (0, 100, 100, 100), p.Controls[1].Bounds, "BT2");
}
示例5: TopDownLayoutTest17
public void TopDownLayoutTest17 ()
{
// Random Complex Layout 2
FlowLayoutPanel p = new FlowLayoutPanel ();
p.Size = new Size (100, 200);
p.FlowDirection = FlowDirection.TopDown;
p.Controls.Add (CreateButton (12, 345, false, DockStyle.Right, new Padding (1, 2, 3, 4), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (9, 44, false, DockStyle.Left, new Padding (6, 3, 2, 7), AnchorStyles.Right | AnchorStyles.Top));
p.Controls.Add (CreateButton (78, 14, false, DockStyle.None, new Padding (5, 1, 2, 4), AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right));
p.Controls.Add (CreateButton (21, 64, false, DockStyle.Left, new Padding (3, 3, 3, 1), AnchorStyles.None));
p.Controls.Add (CreateButton (14, 14, false, DockStyle.Fill, new Padding (11, 4, 6, 3), AnchorStyles.Left | AnchorStyles.Right));
p.Controls.Add (CreateButton (132, 6, false, DockStyle.Fill, new Padding (5, 5, 4, 5), AnchorStyles.Left | AnchorStyles.Right));
p.SetFlowBreak (p.Controls[0], true);
p.SetFlowBreak (p.Controls[2], true);
Assert.AreEqual (new Rectangle (1, 2, 12, 345), p.Controls[0].Bounds, "BS1");
Assert.AreEqual (new Rectangle (22, 3, 9, 44), p.Controls[1].Bounds, "BS2");
Assert.AreEqual (new Rectangle (21, 55, 10, 14), p.Controls[2].Bounds, "BS3");
Assert.AreEqual (new Rectangle (36, 3, 21, 64), p.Controls[3].Bounds, "BS4");
Assert.AreEqual (new Rectangle (44, 72, 10, 14), p.Controls[4].Bounds, "BS5");
Assert.AreEqual (new Rectangle (38, 94, 18, 6), p.Controls[5].Bounds, "BS6");
}
示例6: TopDownLayoutTest13
public void TopDownLayoutTest13 ()
{
// SetFlowBreak 1, 3
FlowLayoutPanel p = new FlowLayoutPanel ();
p.Size = new Size (100, 200);
p.FlowDirection = FlowDirection.TopDown;
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.SetFlowBreak (p.Controls[0], true);
p.SetFlowBreak (p.Controls[2], true);
Assert.AreEqual (new Rectangle (0, 0, 100, 100), p.Controls[0].Bounds, "BO1");
Assert.AreEqual (new Rectangle (100, 0, 100, 100), p.Controls[1].Bounds, "BO2");
Assert.AreEqual (new Rectangle (100, 100, 100, 100), p.Controls[2].Bounds, "BO3");
Assert.AreEqual (new Rectangle (200, 0, 100, 100), p.Controls[3].Bounds, "BO4");
}
示例7: RightToLeftLayoutTest17
public void RightToLeftLayoutTest17 ()
{
// Random Complex Layout 2
FlowLayoutPanel p = new FlowLayoutPanel ();
p.FlowDirection = FlowDirection.RightToLeft;
p.Controls.Add (CreateButton (12, 345, false, DockStyle.Bottom, new Padding (1, 2, 3, 4), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (9, 44, false, DockStyle.Top, new Padding (6, 3, 2, 7), AnchorStyles.Right | AnchorStyles.Top));
p.Controls.Add (CreateButton (78, 14, false, DockStyle.None, new Padding (5, 1, 2, 4), AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right));
p.Controls.Add (CreateButton (21, 64, false, DockStyle.Top, new Padding (3, 3, 3, 1), AnchorStyles.None));
p.Controls.Add (CreateButton (14, 14, false, DockStyle.Fill, new Padding (11, 4, 6, 3), AnchorStyles.Top | AnchorStyles.Bottom));
p.Controls.Add (CreateButton (132, 6, false, DockStyle.Fill, new Padding (5, 5, 4, 5), AnchorStyles.Top | AnchorStyles.Bottom));
p.SetFlowBreak (p.Controls[0], true);
p.SetFlowBreak (p.Controls[2], true);
Assert.AreEqual (new Rectangle (185, 2, 12, 345), p.Controls[0].Bounds, "AS1");
Assert.AreEqual (new Rectangle (189, 354, 9, 44), p.Controls[1].Bounds, "AS2");
Assert.AreEqual (new Rectangle (103, 352, 78, 49), p.Controls[2].Bounds, "AS3");
Assert.AreEqual (new Rectangle (176, 408, 21, 64), p.Controls[3].Bounds, "AS4");
Assert.AreEqual (new Rectangle (153, 409, 14, 61), p.Controls[4].Bounds, "AS5");
Assert.AreEqual (new Rectangle (6, 410, 132, 58), p.Controls[5].Bounds, "AS6");
}
示例8: LeftToRightLayoutTest13
public void LeftToRightLayoutTest13 ()
{
// SetFlowBreak 1, 3
FlowLayoutPanel p = new FlowLayoutPanel ();
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.Controls.Add (CreateButton (100, 100, false, DockStyle.None, new Padding (), AnchorStyles.Left | AnchorStyles.Top));
p.SetFlowBreak (p.Controls[0], true);
p.SetFlowBreak (p.Controls[2], true);
Assert.AreEqual (new Rectangle (0, 0, 100, 100), p.Controls[0].Bounds, "O1");
Assert.AreEqual (new Rectangle (0, 100, 100, 100), p.Controls[1].Bounds, "O2");
Assert.AreEqual (new Rectangle (100, 100, 100, 100), p.Controls[2].Bounds, "O3");
Assert.AreEqual (new Rectangle (0, 200, 100, 100), p.Controls[3].Bounds, "O4");
}
示例9: getExtensions
private void getExtensions(string path)
{
allExtensions = new List<string>();
included = new List<string>();
parseFromDirectory(path, true);
Form prompt = new Form();
prompt.AutoSize = true;
prompt.Text = "Choose Extensions";
FlowLayoutPanel panel = new FlowLayoutPanel();
panel.AutoSize = true;
List<CheckBox> lc = new List<CheckBox>();
for (int i = 0; i < allExtensions.Count; i++)
{
lc.Add(new CheckBox());
lc[i].Text = allExtensions[i];
panel.Controls.Add(lc[i]);
panel.SetFlowBreak(lc[i], true);
}
Button ok = new Button() { Text = "Confirm" };
ok.Click += (sender, e) => {
for (int i = 0; i < lc.Count; i++)
{
if (lc[i].Checked) included.Add(lc[i].Text);
}
prompt.Close();
};
Button no = new Button() { Text = "Cancel" };
no.Click += (sender, e) => { prompt.Close(); };
panel.Controls.Add(ok);
panel.Controls.Add(no);
prompt.Controls.Add(panel);
prompt.ShowDialog();
}
示例10: addTank
private static void addTank(FlowLayoutPanel printerPanel, InkTank tank)
{
// add label
string tankName = tank.Color.Name;
if (tank.IsPhoto)
tankName = "Photo " + tankName;
// add progress bar
ColorBar barTank = new ColorBar();
if (tank.IsPhoto)
{
//Color.FromArgb(0, tank.Color);
const int upVal = 100;
barTank.ForeColor = Color.FromArgb(
Math.Min(255, tank.Color.R + upVal),
Math.Min(255, tank.Color.G + upVal),
Math.Min(255, tank.Color.B + upVal));
}
else
{
barTank.ForeColor = tank.Color;
}
barTank.TextColor = Color.FromArgb(255 - barTank.ForeColor.R,
255 - barTank.ForeColor.G,
255 - barTank.ForeColor.B);
barTank.Height = 15;
barTank.Width = printerPanel.Width - barTank.Left * 2;
barTank.Value = (int)tank.Pct;
barTank.Text = tankName + " (" + tank.Pct + "%)";
printerPanel.SetFlowBreak(barTank, true);
printerPanel.Controls.Add(barTank);
}
示例11: UpdateNews
/// <summary>
/// ��������� ������ ��������
/// </summary>
void UpdateNews()
{
current.UpdateConnection();
QueryResult news = Query.Execute(current.Connection, @"select datemess, title, message, newsid from news n
where newsid not in (select newsid from usernews)
or newsid in (select newsid from usernews un where un.userid = :1)
or newsid in (select newsid from usernews un where un.userid = :2)
order by datemess desc", new string[] { "1", "2" }, new object[] { current.User.id, current.User.groupid });
current.CloseConnection();
int NewsRow = NewsLayoutPanel.RowCount-1;
NewsLayoutPanel.RowCount += news.Rows.Count;
foreach (DataRow item in news.Rows)
{
FlowLayoutPanel flowpanel = new FlowLayoutPanel();
flowpanel.Dock = DockStyle.Top;
flowpanel.AutoSize = true;
Label Title = new Label();
Title.AutoSize = true;
Title.Text = ((DateTime)item["datemess"]).ToString("dd.MM.yyyy HH:mm") + " " + item["title"].ToString();
Title.ForeColor = Color.Blue;
//Title.Font = new Font("Times New Roman", 12, FontStyle.Bold);
Title.Font = new Font("Tahoma", 9, FontStyle.Bold);
flowpanel.Controls.Add(Title);
flowpanel.SetFlowBreak(Title, true);
Label Message = new Label();
Message.AutoSize = true;
Message.Text = item["message"].ToString();
//Message.Font = new Font("Times New Roman", 12);
Message.Font = new Font("Tahoma", 9);
flowpanel.Controls.Add(Message);
NewsLayoutPanel.Controls.Add(flowpanel, 0, NewsRow);
NewsRow++;
}
}
示例12: Dialog
private Dialog()
{
Name = Properties.Resources.ResourceManager.GetString("Message");
Icon = Icon = Properties.Resources.GClientGTLogo;
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
pl = new Panel();
pl.Dock = DockStyle.Fill;
panel2 = new Panel();
label1 = new Label();
label1.AutoSize = true;
label1.Font = new Font("Century Gothic", 11.75F);
label1.ForeColor = Color.FromArgb(224, 224, 224);
label1.Location = new Point(4, 6);
label1.Name = "label1";
label1.Size = new Size(96, 21);
label1.TabIndex = 1;
label1.Text = "GClient GT";
panel2.BackColor = Color.FromArgb(45, 45, 45);
panel2.Controls.Add(label1);
panel2.Location = new Point(1, 1);
panel2.Name = "panel2";
panel2.Size = new Size(498, 33);
panel2.TabIndex = 3;
Controls.Add(panel2);
flp = new FlowLayoutPanel();
flp.Dock = DockStyle.Fill;
lblMessage = new Label();
lblMessage.Font = new Font("Segoe UI", 10);
lblMessage.ForeColor = Color.White;
lblMessage.AutoSize = true;
txtPl = new Panel();
txtPl.BorderStyle = BorderStyle.None;
txtPl.Width = 460;
txtPl.Height = 28;
txtPl.Padding = new Padding(5);
txtPl.BackColor = Color.White;
txtPl.Margin = new Padding(0, 15, 0, 0);
txtPl.Paint += txtPl_Paint;
txtInput = new TextBox();
txtInput.Dock = DockStyle.Fill;
txtInput.BorderStyle = BorderStyle.None;
txtInput.Font = new Font("Segoe UI", 9);
txtInput.KeyDown += txtInput_KeyDown;
txtInput.BackColor = Color.FromArgb(240, 240, 240);
txtInput.Multiline = true;
txtPl.Controls.Add(txtInput);
flpButtons = new FlowLayoutPanel();
flpButtons.Dock = DockStyle.Bottom;
flpButtons.FlowDirection = FlowDirection.RightToLeft;
flpButtons.Height = 35;
btnCancel = new Button();
btnCancel.Text = Properties.Resources.ResourceManager.GetString("Cancel");
btnCancel.ForeColor = Color.FromArgb(170, 170, 170);
btnCancel.Font = new Font("Segoe UI", 8);
btnCancel.Padding = new Padding(3);
btnCancel.FlatStyle = FlatStyle.Flat;
btnCancel.Height = 30;
btnCancel.Click += btnCancel_Click;
btnOK = new Button();
btnOK.Text = Properties.Resources.ResourceManager.GetString("OK");
btnOK.ForeColor = Color.FromArgb(170, 170, 170);
btnOK.Font = new Font("Segoe UI", 8);
btnOK.Padding = new Padding(3);
btnOK.FlatStyle = FlatStyle.Flat;
btnOK.Height = 30;
btnOK.Click += btnOK_Click;
flpButtons.Controls.Add(btnCancel);
flpButtons.Controls.Add(btnOK);
flp.Controls.Add(lblMessage);
flp.SetFlowBreak(lblMessage, true);
flp.Controls.Add(txtPl);
flp.SetFlowBreak(txtPl, true);
flp.Controls.Add(flpButtons);
pl.Controls.Add(flp);
Text = Properties.Resources.ResourceManager.GetString("Message");
Controls.Add(pl);
Controls.Add(flpButtons);
FormBorderStyle = FormBorderStyle.None;
BackColor = Color.FromArgb(35, 35, 35);
StartPosition = FormStartPosition.CenterScreen;
Padding = new Padding(20, 55, 20, 20);
Width = 500;
Height = 200;
}
示例13: DialogNoBoxYesNo
private DialogNoBoxYesNo()
{
Name = Properties.Resources.ResourceManager.GetString("Message");
Icon = Icon = Properties.Resources.GClientGTLogo;
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
MinimizeBox = false;
pl = new Panel();
pl.Dock = DockStyle.Fill;
panel2 = new Panel();
label1 = new Label();
label1.AutoSize = true;
label1.Font = new Font("Century Gothic", 11.75F);
label1.ForeColor = Color.FromArgb(224, 224, 224);
label1.Location = new Point(4, 6);
label1.Name = "label1";
label1.Size = new Size(96, 21);
label1.TabIndex = 1;
label1.Text = "GClient GT";
panel2.BackColor = Color.FromArgb(45, 45, 45);
panel2.Controls.Add(label1);
panel2.Location = new Point(1, 1);
panel2.Name = "panel2";
panel2.Size = new Size(498, 33);
panel2.TabIndex = 3;
Controls.Add(panel2);
flp = new FlowLayoutPanel();
flp.Dock = DockStyle.Fill;
lblMessage = new Label();
lblMessage.Font = new Font("Segoe UI", 10);
lblMessage.ForeColor = Color.White;
lblMessage.AutoSize = true;
flpButtons = new FlowLayoutPanel();
flpButtons.Dock = DockStyle.Bottom;
flpButtons.FlowDirection = FlowDirection.RightToLeft;
flpButtons.Height = 35;
btnNO = new Button();
btnNO.Text = Properties.Resources.ResourceManager.GetString("NO");
btnNO.ForeColor = Color.FromArgb(170, 170, 170);
btnNO.Font = new Font("Segoe UI", 8);
btnNO.Padding = new Padding(3);
btnNO.FlatStyle = FlatStyle.Flat;
btnNO.Height = 30;
btnNO.Click += btnNO_Click;
btnYES = new Button();
btnYES.Text = Properties.Resources.ResourceManager.GetString("YES"); ;
btnYES.ForeColor = Color.FromArgb(170, 170, 170);
btnYES.Font = new Font("Segoe UI", 8);
btnYES.Padding = new Padding(3);
btnYES.FlatStyle = FlatStyle.Flat;
btnYES.Height = 30;
btnYES.Click += btnYES_Click;
flpButtons.Controls.Add(btnYES);
flpButtons.Controls.Add(btnNO);
flp.Controls.Add(lblMessage);
flp.SetFlowBreak(lblMessage, true);
flp.Controls.Add(flpButtons);
pl.Controls.Add(flp);
Text = Properties.Resources.ResourceManager.GetString("Message");
Controls.Add(pl);
Controls.Add(flpButtons);
FormBorderStyle = FormBorderStyle.None;
BackColor = Color.FromArgb(35, 35, 35);
StartPosition = FormStartPosition.CenterScreen;
Padding = new Padding(20, 55, 20, 20);
Width = 500;
Height = 155;
}
示例14: worldMapRegionsToolStripMenuItem_Click
private void worldMapRegionsToolStripMenuItem_Click(object sender, EventArgs e)
{
string test = Path.GetFileNameWithoutExtension(_lastKnownPath);
if (test.Substring(0, 5) != "wmset")
{
Console.WriteLine("WMSET: Please open your lingual wmset file again");
return;
}
string lingual = Wmset.ReturnLingual(_lastKnownPath);
string dir = Path.GetDirectoryName(_lastKnownPath);
string path = $"{dir}\\wmset{lingual}.Section2";
wm2 = new WM_Section2(path);
Form wm2Editor = new Form
{
Size = new Size(1250, 800),
Text = "World Map regions editor",
MaximizeBox = false,
MinimizeBox = false
};
dynamicForm = wm2Editor;
wm2Editor.Closing += (o, args) => wm2.EndJob();
SplitContainer wm2SplitContainer = new SplitContainer();
wm2SplitContainer.Dock = DockStyle.Fill;
wm2SplitContainer.SplitterDistance = 0;
wm2SplitContainer.IsSplitterFixed = true;
pbBox = new PictureBox
{
Size = new Size(800,768),
SizeMode = PictureBoxSizeMode.AutoSize,
Image = Properties.Resources.map2,
Dock = DockStyle.Fill
};
wm2SplitContainer.Panel2.Controls.Add(pbBox);
wm2.ReceiveBitmap(new Bitmap(pbBox.Image));
for (int i = 0; i < 768; i++)
wm2.ColorizeBlock(i,wm2.ReadNextRegion());
pbBox.Image = wm2.GetColored;
pbBox.MouseClick += WM2UpdateBlockID;
FlowLayoutPanel flow = new FlowLayoutPanel {Dock = DockStyle.Fill};
wm2SelectedChunk = new Label {Text = $"Selected chunk: {wm2.selectedRegion}", AutoSize = true};
wm2numeric = new NumericUpDown {Minimum = 0, Maximum = 0xFF, Value = wm2.regions[wm2.selectedRegion]};
wm2numeric.ValueChanged += WM2UpdateRegion;
flow.Controls.Add(wm2SelectedChunk);
flow.Controls.Add(wm2numeric);
flow.SetFlowBreak(wm2SelectedChunk, true);
flow.SetFlowBreak(wm2numeric,true);
wm2Editor.Controls.Add(wm2SplitContainer);
wm2SplitContainer.Panel1.Controls.Add(flow);
Button compileButton = new Button {Text= "Compile & save"};
compileButton.Click += CompileButton_Click;
flow.Controls.Add(compileButton);
wm2Editor.FormBorderStyle = FormBorderStyle.Fixed3D;
wm2Editor.Show();
}
示例15: AddUIElements
//.........这里部分代码省略.........
Maximum = 10m,
Increment = 0.1m,
AutoSize = true
};
_lblOctaves1 = new Label {
Text = "Octaves:",
AutoSize = true,
Padding = labelPadding
};
_txtOctaves1 = new NumericUpDown() {
Value =7,
AutoSize = true,
Minimum = 1,
Maximum = 20,
};
_lblNoise2 = new Label {
Text = "Noise:",
AutoSize = true,
Padding = labelPadding
};
_txtNoise2 = new NumericUpDown {
Value = 2.5m,
DecimalPlaces = 2,
Minimum = 0m,
Maximum = 10m,
Increment = 0.1m,
AutoSize = true
};
_lblPersistence2 = new Label {
Text = "Persistence:",
AutoSize = true,
Padding = labelPadding
};
_txtPersistence2 = new NumericUpDown {
Value = 0.8m,
DecimalPlaces = 2,
Minimum = 0m,
Maximum = 10m,
Increment = 0.1m,
AutoSize = true
};
_lblOctaves2 = new Label {
Text = "Octaves:",
AutoSize = true,
Padding = labelPadding
};
_txtOctaves2 = new NumericUpDown() {
Value = 3,
AutoSize = true,
Minimum = 1,
Maximum = 20
};
_hmImg = new PictureBox() {
Image = _terrain.HeightMapImg,
MaximumSize = new Size(64,64),
MinimumSize = new Size(64,64),
SizeMode = PictureBoxSizeMode.StretchImage,
BackColor = Color.White
};
_panel.Controls.Add(_lblNoise1);
_panel.Controls.Add(_txtNoise1);
_panel.Controls.Add(_lblPersistence1);
_panel.Controls.Add(_txtPersistence1);
_panel.Controls.Add(_lblOctaves1);
_panel.Controls.Add(_txtOctaves1);
_panel.Controls.Add(_lblNoise2);
_panel.Controls.Add(_txtNoise2);
_panel.Controls.Add(_lblPersistence2);
_panel.Controls.Add(_txtPersistence2);
_panel.Controls.Add(_lblOctaves2);
_panel.Controls.Add(_txtOctaves2);
_panel.SetFlowBreak(_txtOctaves2, true);
_panel.Controls.Add(_lblSeed);
_panel.Controls.Add(_txtSeed);
_panel.Controls.Add(_generateButton);
_tblLayout = new TableLayoutPanel {
Dock = DockStyle.Top,
AutoSize = true
};
_tblLayout.RowStyles.Add(new RowStyle(SizeType.AutoSize));
_tblLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
_tblLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
_tblLayout.Controls.Add(_panel, 0,0);
_tblLayout.Controls.Add(_hmImg, 1, 0);
Window.Controls.Add(_tblLayout);
}