本文整理汇总了C#中System.Windows.Forms.TableLayoutPanel.SetRow方法的典型用法代码示例。如果您正苦于以下问题:C# TableLayoutPanel.SetRow方法的具体用法?C# TableLayoutPanel.SetRow怎么用?C# TableLayoutPanel.SetRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TableLayoutPanel
的用法示例。
在下文中一共展示了TableLayoutPanel.SetRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private void Init()
{
layoutPanel = new TableLayoutPanel();
layoutPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.InsetDouble;
layoutPanel.Dock = DockStyle.Fill;
this.machinePanel.Controls.Add(layoutPanel);
int row = 4, col = 4;
DynamicLayout(layoutPanel, row, col);
int index = 1;
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
MachineControl machine = new MachineControl();
uiMachines[index-1] = machine;
machine.Dock = DockStyle.Fill;
//machine.IPAddress = string.Format("192.168.0.{0:G}", 4 + index);
machine.IPAddress = MainForm.Sixteen_IP[index - 1];
machine.anotherName = MainForm.Sixteen_Name[index - 1];
layoutPanel.Controls.Add(machine);
layoutPanel.SetRow(machine, i);
layoutPanel.SetColumn(machine, j);
index++;
}
}
}
示例2: CreateAdvancedSettings
private void CreateAdvancedSettings(TabPage tabPage)
{
var advancedSettings = new List<String>(new[] { "VariableRefactoringStartingSeed", "ProgramTemplate" });
foreach (SettingsProperty r in Settings.Default.Properties)
if (r.Name.StartsWith("Regex"))
advancedSettings.Add(r.Name);
advancedSettings.Sort();
var table = new TableLayoutPanel {ColumnCount = 2, RowCount = advancedSettings.Count() + 1, Dock = DockStyle.Fill};
var row = 0;
foreach (var s in advancedSettings)
{
var l = new Label { Text = s, Anchor = AnchorStyles.Left, AutoSize = true };
table.Controls.Add(l);
table.SetRow(l, row);
table.SetColumn(l, 0);
var t = new TextBox { Dock = DockStyle.Fill, Multiline = true, ScrollBars = ScrollBars.Vertical, Height=38 };
t.DataBindings.Add(new Binding("Text", Settings.Default, s, true,DataSourceUpdateMode.OnPropertyChanged));
table.Controls.Add(t);
table.SetRow(t, row++);
table.SetColumn(t, 1);
}
for (var i = 0; i < table.ColumnCount; i++)
table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
for (var i = 0; i < table.RowCount; i++)
table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
tabPage.Controls.Add(table);
}
示例3: TestExtenderMethods
public void TestExtenderMethods ()
{
TableLayoutPanel p = new TableLayoutPanel ();
Control c = new Button ();
Assert.AreEqual (new TableLayoutPanelCellPosition (-1, -1), p.GetCellPosition (c), "A1");
Assert.AreEqual (-1, p.GetColumn (c), "A2");
Assert.AreEqual (1, p.GetColumnSpan (c), "A3");
Assert.AreEqual (-1, p.GetRow (c), "A4");
Assert.AreEqual (1, p.GetRowSpan (c), "A5");
p.SetCellPosition (c, new TableLayoutPanelCellPosition (1, 1));
Assert.AreEqual (new TableLayoutPanelCellPosition (1, 1), p.GetCellPosition (c), "A6");
p.SetColumn (c, 2);
Assert.AreEqual (2, p.GetColumn (c), "A7");
p.SetRow (c, 2);
Assert.AreEqual (2, p.GetRow (c), "A9");
p.SetColumnSpan (c, 2);
Assert.AreEqual (2, p.GetColumnSpan (c), "A8");
p.SetRowSpan (c, 2);
Assert.AreEqual (2, p.GetRowSpan (c), "A10");
Assert.AreEqual (new TableLayoutPanelCellPosition (2, 2), p.GetCellPosition (c), "A11");
// ???????
//Assert.AreEqual (new TableLayoutPanelCellPosition (-1, -1), p.GetPositionFromControl (c), "A12");
//Assert.AreEqual (c, p.GetControlFromPosition(0, 0), "A13");
}
示例4: TestCellPositioning7
public void TestCellPositioning7 ()
{
// One control has fixed column and row
TableLayoutPanel p = new TableLayoutPanel ();
Control c1 = new Button ();
Control c2 = new Button ();
Control c3 = new Button ();
Control c4 = new Button ();
p.ColumnCount = 2;
p.RowCount = 2;
p.SetColumn (c3, 1);
p.SetRow (c3, 1);
p.Controls.Add (c1);
p.Controls.Add (c2);
p.Controls.Add (c3);
p.Controls.Add (c4);
Assert.AreEqual (new TableLayoutPanelCellPosition (0, 0), p.GetPositionFromControl (c1), "C1");
Assert.AreEqual (new TableLayoutPanelCellPosition (1, 0), p.GetPositionFromControl (c2), "C2");
Assert.AreEqual (new TableLayoutPanelCellPosition (1, 1), p.GetPositionFromControl (c3), "C3");
Assert.AreEqual (new TableLayoutPanelCellPosition (0, 1), p.GetPositionFromControl (c4), "C4");
}
示例5: GenerateGui
private void GenerateGui()
{
var s = config.GetSections().ToList();
s.Sort();
foreach (var section in s)
{
var page = new TabPage(Utilities.GetPrettyName(section));
var panel = new TableLayoutPanel { Dock = DockStyle.Fill, ColumnCount = 2 };
var lastComment = "";
var i = 0;
foreach (var option in config.EnumSection(section))
{
if (!new[] { "#", ";", "//" }.Any(c => option.StartsWith(c)))
{
var l = new Label
{
Text = Utilities.GetPrettyName(option) + ":",
TextAlign = ContentAlignment.MiddleLeft,
//Width = tabControlMain.Width/4,
AutoEllipsis = true
};
panel.SetColumn(l, 0);
panel.SetRow(l, i);
panel.Controls.Add(l);
Control t = null;
var defaultValue = config.GetSetting(section, option);
var tooltip = "";
// Check previous comment
if (!String.IsNullOrEmpty(lastComment))
{
var tmp = lastComment.Trim().Split(new[] { ']' }, 2);
if (tmp.Length > 1)
tooltip = tmp[1].Trim();
var m = Regex.Match(lastComment, @"\[(?<min>[-]?[\d.]{1,8}):(?<max>[-]?[\d.]{1,8})\]");
if (m.Success)
{
t = new NumericUpDown
{
Minimum = decimal.Parse(m.Groups["min"].Value),
Maximum = decimal.Parse(m.Groups["max"].Value),
Value = decimal.Parse(defaultValue)
};
((NumericUpDown)t).ValueChanged += (o, args) => { config.AddSetting(section, option, ((NumericUpDown)o).Value.ToString()); };
}
else
{
m = Regex.Match(lastComment, @"\[(?<value>.+,.+)\]");
if (m.Success)
{
t = new ComboBox { DropDownStyle = ComboBoxStyle.DropDownList, Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right };
var items = new List<String>();
var description = new List<string>();
foreach (var v in m.Groups["value"].Value.Split(new[] { ',' }))
{
String name, value;
if (v.Contains(':'))
{
var parts = v.Split(new[] { ':' }, 2);
name = parts[1];
value = parts[0];
description.Add(String.Format(" {0} ({1})", name, value));
}
else
{
name = v;
value = v;
}
items.Add(value);
((ComboBox)t).Items.Add(name);
if (defaultValue.Equals(value))
{
((ComboBox)t).SelectedIndex = ((ComboBox)t).Items.Count - 1;
}
}
if (description.Count > 0)
{
if (!String.IsNullOrEmpty(tooltip))
tooltip += Environment.NewLine + Environment.NewLine;
tooltip += "Available options:" + Environment.NewLine +
String.Join(Environment.NewLine, description);
}
t.Tag = items;
// No default value match
if (((ComboBox)t).SelectedIndex < 0)
{
((ComboBox)t).DropDownStyle = ComboBoxStyle.DropDown;
t.Text = defaultValue;
//.........这里部分代码省略.........
示例6: removeRow
/// <summary>
/// Removes a row from the scanner form table
/// </summary>
/// <param name="panel">The table control</param>
/// <param name="rowIndex">which row to remove</param>
private void removeRow(TableLayoutPanel panel, int rowIndex)
{
panel.RowStyles.RemoveAt(rowIndex);
for (int columnIndex = 0; columnIndex < panel.ColumnCount; columnIndex++)
{
var control = panel.GetControlFromPosition(columnIndex, rowIndex);
panel.Controls.Remove(control);
}
for (int i = rowIndex + 1; i < panel.RowCount; i++)
{
for (int columnIndex = 0; columnIndex < panel.ColumnCount; columnIndex++)
{
var control = panel.GetControlFromPosition(columnIndex, i);
panel.SetRow(control, i - 1);
}
}
panel.RowCount--;
}
示例7: AddTable
private void AddTable(string name, List<BasicTable.TableItem> items)
{
int row = 0;
var panel = new TableLayoutPanel
{
ColumnCount = 2,
RowCount = items.Count
};
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 35));
panel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 65));
// ReSharper disable ForCanBeConvertedToForeach
for (int i = 0; i < items.Count; i++) // ReSharper restore ForCanBeConvertedToForeach
{
panel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
}
foreach (var item in items)
{
panel.Controls.Add(item.Control);
panel.SetRow(item.Control, row);
panel.SetColumn(item.Control, 1);
if (string.IsNullOrEmpty(item.Name) == false)
{
var label = new Label()
{
Text = string.Format(Properties.Localization.Editor_BasicTable_ItemLabelFormat, item.Name),
Dock = DockStyle.Fill,
AutoSize = true,
TextAlign = ContentAlignment.MiddleRight,
};
panel.Controls.Add(label);
panel.SetRow(label, row);
panel.SetColumn(label, 0);
}
else
{
panel.SetColumnSpan(item.Control, 2);
}
if (item.Binding != null)
{
item.Control.DataBindings.Add(item.Binding);
}
row++;
}
panel.AutoSize = true;
panel.Dock = DockStyle.Fill;
var group = new GroupBox();
group.Text = name;
group.MinimumSize = new Size(320, 0);
group.AutoSize = true;
group.Controls.Add(panel);
this._PlayerBasicPanel.Controls.Add(group);
}
示例8: AddControls
private void AddControls()
{
List<Requirement> reqs = GetAllRequirements();
panel.Controls.Clear();
TableLayoutPanel pn = new TableLayoutPanel
{
Dock = DockStyle.Fill,
RowCount = reqs.Count,
ColumnCount = 2,
AutoSize = true,
AutoScroll = true, ColumnStyles =
{
new ColumnStyle{Width=30,SizeType=SizeType.Percent},
new ColumnStyle{Width=70,SizeType=SizeType.Percent},
}
};
List<Control> labels = reqs.GenerateLabels();
List<Control> ctrls = reqs.GenerateControls(Settings.Instance.GlobalMetadataDictionary);
for (int x = 0; x < reqs.Count; x++)
{
pn.RowStyles.Add(new RowStyle { Height = 30, SizeType = SizeType.Absolute });
pn.Controls.Add(labels[x]);
pn.Controls.Add(ctrls[x]);
pn.SetColumn(labels[x], 0);
pn.SetRow(labels[x], x);
pn.SetColumn(ctrls[x], 1);
pn.SetRow(ctrls[x], x);
}
pn.RowStyles.Add(new RowStyle { Height = 1, SizeType = SizeType.Percent });
Panel pp = new Panel
{
Dock = DockStyle.Fill,
};
pn.Controls.Add(pp);
pn.SetColumn(pp,0);
pn.SetRow(pp,reqs.Count);
pn.SetColumn(pp,2);
panel.Controls.Add(pn);
}
示例9: MoveUp
/// <summary>
/// move up controls sau khi xoá
/// </summary>
/// <param name="TLP"></param>
private void MoveUp(TableLayoutPanel TLP, int DelRow)
{
for (int i = ++DelRow; i <= TLP.RowCount; i++)
{
int BackRow = i - 1;
for (int y = 0; y < TLP.ColumnCount; y++)
{
Control c = TLP.Controls[BackRow * TLP.ColumnCount + y];
TLP.SetRow(c, BackRow);
}
}
}
示例10: LoadRooms
private void LoadRooms(TabPage roomTypeTab)
{
try
{
long TypeID = ((RoomType)roomTypeTab.Tag).Typeid;
KryptonPanel roomOutlinePane = new KryptonPanel();
TableLayoutPanel roomLayoutPane = new TableLayoutPanel();
RoomCollection mRoomColl = new RoomCollection();
if (TypeID > -1)
mRoomColl.Where(Room.TypeidColumn.ColumnName, TypeID).Load();
else
mRoomColl.Load();
roomLayoutPane.RowCount = mRoomColl.Count >= 26 ? mRoomColl.Count - 1 : 25;
roomLayoutPane.ColumnCount = 12;
roomLayoutPane.Size = new Size(ROOM_BUTTON_WIDTH * roomLayoutPane.RowCount + 3, ROOM_BUTTON_HEIGHT * roomLayoutPane.ColumnCount + 3);
int currRowIndex = 0; int currColIndex = 0;
roomLayoutPane.SuspendLayout();
foreach (Room room in mRoomColl)
{
var roomButton = new KryptonButton
{
Name = ("RM" + room.Roomid),
Size = new Size(ROOM_BUTTON_WIDTH, ROOM_BUTTON_HEIGHT),
Text =
(room.Name.Trim().ToLowerInvariant().StartsWith("room")
? room.Name
: "Room " + room.Name),
Tag = room
};
CreateRoomMenu(roomButton);
roomLayoutPane.Controls.Add(roomButton);
roomLayoutPane.SetRow(roomButton, currRowIndex);
roomLayoutPane.SetColumn(roomButton, currColIndex);
if (currColIndex == roomLayoutPane.ColumnCount)
{
currRowIndex++;
currColIndex = 0;
}
else
{
currColIndex++;
}
}
roomLayoutPane.ResumeLayout();
roomLayoutPane.BackColor = Color.Transparent;
roomOutlinePane.Dock = DockStyle.Fill;
roomOutlinePane.Controls.Add(roomLayoutPane);
roomTypeTab.Controls.Add(roomOutlinePane); //Add to Current Tab
}
catch (Exception ex) { }
}
示例11: RoundOverview
public RoundOverview(int round, int count, int correct) {
// TODO: Make theme-aware.
correctCount.ForeColor = correctLabel.ForeColor = correctRatio.ForeColor = AnswerColors.Correct;
incorrectCount.ForeColor = incorrectLabel.ForeColor = incorrectRatio.ForeColor = AnswerColors.Incorrect;
base.Font = new Font(base.Font.FontFamily, base.Font.Size * 1.4f);
FontFamily titleFontFamily = Array.Exists(FontFamily.Families, x => x.Name == "Cambria")
? new FontFamily("Cambria")
: roundNo.Font.FontFamily;
roundNo.Font = new Font(titleFontFamily, base.Font.Size * 2.0f, FontStyle.Bold);
Disposed += delegate {
Font.Dispose();
roundNo.Font.Dispose();
};
prompt.ForeColor = SystemColors.GrayText;
table = new TableLayoutPanel { RowCount = 4, ColumnCount = 3 };
foreach (var label in new[] { roundNo, correctLabel, incorrectLabel, correctCount, incorrectCount, correctRatio, incorrectRatio, prompt }) {
label.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom | AnchorStyles.Top;
label.TextAlign = ContentAlignment.MiddleLeft;
label.AutoSize = true;
table.Controls.Add(label);
}
prompt.TextAlign = ContentAlignment.MiddleCenter;
table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
table.RowStyles.Add(new RowStyle(SizeType.Percent, 0.5f));
table.RowStyles.Add(new RowStyle(SizeType.Percent, 0.5f));
table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 1.0f));
table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
// Row 0: Header
table.SetRow(roundNo, 0);
table.SetColumn(roundNo, 0);
table.SetColumnSpan(roundNo, 3);
// Row 1: Correct guesses
table.SetRow(correctLabel, 1);
table.SetRow(correctCount, 1);
table.SetRow(correctRatio, 1);
table.SetColumn(correctLabel, 0);
table.SetColumn(correctCount, 1);
table.SetColumn(correctRatio, 2);
// Row 2: Incorrect guesses
table.SetRow(incorrectLabel, 2);
table.SetRow(incorrectCount, 2);
table.SetRow(incorrectRatio, 2);
table.SetColumn(incorrectLabel, 0);
table.SetColumn(incorrectCount, 1);
table.SetColumn(incorrectRatio, 2);
// Row 3: Prompt
table.SetRow(prompt, 3);
table.SetColumn(prompt, 0);
table.SetColumnSpan(prompt, 3);
Controls.Add(table);
Resize += delegate { Layout(); };
UpdateScore(round, count, correct);
}
示例12: MainForm
public MainForm()
{
InitializeComponent();
dictCharts = new Dictionary<int, Chart[]>();
signals = new Tuple<double[], double[]>[9];
spectors = new List<Complex[]>();
TableLayoutPanel tableLayoutPanel;
// Создаем для трех отведений.
for (int t = 0; t < 3; t++)
{
tableLayoutPanel = new TableLayoutPanel();
tabControl.TabPages[t].Controls.Add(tableLayoutPanel);
tableLayoutPanel.Dock = DockStyle.Fill;
tableLayoutPanel.ColumnCount = 2;
tableLayoutPanel.RowCount = 4;
tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));
Chart[] charts = new Chart[6];
for (int i = 0; i < 6; i++)
{
int row = i < 3 ? i / 2 : (i + 1) / 2;
int col = i < 3 ? i % 2 : (i + 1) % 2;
Chart chart = charts[i] = CreateChart();
tableLayoutPanel.Controls.Add(chart);
tableLayoutPanel.SetRow(chart, row);
tableLayoutPanel.SetColumn(chart, col);
if ((i + 1) % 3 == 0)
{
tableLayoutPanel.SetColumnSpan(chart, 2);
}
}
dictCharts[t] = charts;
}
// Создаем для остальных отведений.
tableLayoutPanel = new TableLayoutPanel();
tabControl.TabPages[3].Controls.Add(tableLayoutPanel);
tableLayoutPanel.Dock = DockStyle.Fill;
tableLayoutPanel.ColumnCount = 1;
tableLayoutPanel.RowCount = 9;
tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
for (int i = 0; i < 9; i++)
{
tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100 / 9));
}
for (int i = 0; i < 9; i++)
{
Chart chart = CreateChart();
tableLayoutPanel.Controls.Add(chart);
tableLayoutPanel.SetRow(chart, i);
tableLayoutPanel.SetColumn(chart, 0);
dictCharts[3 + i] = new Chart[] { chart };
chart.Titles.Add(new string[] { "AVR", "AVL", "AVF", "C1", "C2", "C3", "C4", "C5", "C6" }[i]);
chart.Titles[0].Docking = Docking.Left;
}
EnableButtons(false);
}
示例13: SetControl
private void SetControl(TableLayoutPanel tb, Control con, int row, int col)
{
tb.Controls.Add(con);
tb.SetRow(con, row);
tb.SetColumn(con, col);
}
示例14: AppErrorDialog
private AppErrorDialog()
{
if (!appErrorInitialized)
{
Application.EnableVisualStyles();
appErrorInitialized = true;
}
string title = FL.AppErrorDialogTitle;
string appName = FL.AppName;
if (!string.IsNullOrEmpty(appName))
{
title = appName + " – " + title;
}
this.BackColor = SystemColors.Window;
this.ControlBox = false;
this.MinimizeBox = false;
this.MaximizeBox = false;
this.Font = SystemFonts.MessageBoxFont;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
this.ShowInTaskbar = false;
this.Size = new Size(550, 300);
this.StartPosition = FormStartPosition.CenterScreen;
this.Text = title;
this.TopMost = true;
tablePanel = new TableLayoutPanel();
tablePanel.Dock = DockStyle.Fill;
tablePanel.RowCount = 6;
tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
tablePanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
tablePanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 0));
tablePanel.RowStyles.Add(new RowStyle(SizeType.AutoSize));
tablePanel.ColumnCount = 1;
tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
this.Controls.Add(tablePanel);
introLabel = new Label();
introLabel.BackColor = Color.FromArgb(221, 74, 59);
introLabel.ForeColor = Color.White;
introLabel.Dock = DockStyle.Fill;
introLabel.AutoSize = true;
introLabel.Font = new Font(
SystemFonts.MessageBoxFont.FontFamily,
SystemFonts.MessageBoxFont.SizeInPoints * 1.3f,
SystemFonts.MessageBoxFont.Style);
introLabel.MaximumSize = new Size(this.ClientSize.Width, 0);
introLabel.Padding = new Padding(6, 4, 7, 6);
introLabel.Margin = new Padding();
introLabel.UseCompatibleTextRendering = false;
introLabel.UseMnemonic = false;
tablePanel.Controls.Add(introLabel);
tablePanel.SetRow(introLabel, 0);
tablePanel.SetColumn(introLabel, 0);
errorPanel = new Panel();
errorPanel.AutoScroll = true;
errorPanel.Dock = DockStyle.Fill;
errorPanel.Margin = new Padding(7, 8, 10, 6);
errorPanel.Padding = new Padding();
tablePanel.Controls.Add(errorPanel);
tablePanel.SetRow(errorPanel, 1);
tablePanel.SetColumn(errorPanel, 0);
errorLabel = new Label();
errorLabel.AutoSize = true;
errorLabel.MaximumSize = new Size(this.ClientSize.Width - 20, 0);
errorLabel.Padding = new Padding();
errorLabel.Margin = new Padding();
errorLabel.UseCompatibleTextRendering = false;
errorLabel.UseMnemonic = false;
errorPanel.Controls.Add(errorLabel);
logLabel = new LinkLabel();
logLabel.AutoSize = true;
logLabel.MaximumSize = new Size(this.ClientSize.Width - 20, 0);
logLabel.Margin = new Padding(8, 6, 10, 0);
logLabel.Padding = new Padding();
if (FL.LogFileBasePath != null)
{
logLabel.Text = string.Format(FL.AppErrorDialogLogPath, FL.LogFileBasePath.Replace("\\", "\\\u200B") + "*.fl");
string dir = Path.GetDirectoryName(FL.LogFileBasePath).Replace("\\", "\\\u200B");
logLabel.LinkArea = new LinkArea(FL.AppErrorDialogLogPath.IndexOf("{0}", StringComparison.Ordinal), dir.Length);
logLabel.LinkClicked += (s, e) =>
{
Process.Start(Path.GetDirectoryName(FL.LogFileBasePath));
};
}
else
{
logLabel.Text = FL.AppErrorDialogNoLog;
logLabel.LinkArea = new LinkArea(0, 0);
}
logLabel.UseCompatibleTextRendering = false;
logLabel.UseMnemonic = false;
tablePanel.Controls.Add(logLabel);
tablePanel.SetRow(logLabel, 2);
//.........这里部分代码省略.........
示例15: AddControls
private void AddControls()
{
DownloadPluginInfo pinfo = (DownloadPluginInfo) cmbPlugin.SelectedItem;
panel.Controls.Clear();
TableLayoutPanel pn = new TableLayoutPanel
{
Dock = DockStyle.Fill,
RowCount = pinfo.AuthenticationRequirements.Count,
ColumnCount = 2,
AutoSize = true,
AutoScroll = true,
ColumnStyles =
{
new ColumnStyle{Width=30,SizeType=SizeType.Percent},
new ColumnStyle{Width=70,SizeType=SizeType.Percent},
}
};
List<Control> labels = pinfo.AuthenticationRequirements.GenerateLabels();
List<Control> ctrls=pinfo.AuthenticationRequirements.GenerateControls(Settings.Instance.AuthorizationsMetadataDictionary[pinfo.Name]);
for (int x = 0; x < pinfo.AuthenticationRequirements.Count; x++)
{
pn.RowStyles.Add(new RowStyle {Height = 30, SizeType = SizeType.Absolute});
pn.Controls.Add(labels[x]);
pn.Controls.Add(ctrls[x]);
pn.SetColumn(labels[x],0);
pn.SetRow(labels[x], x);
pn.SetColumn(ctrls[x],1);
pn.SetRow(ctrls[x],x);
}
pn.RowStyles.Add(new RowStyle { Height = 1, SizeType = SizeType.Percent });
Panel pp = new Panel
{
Dock = DockStyle.Fill,
};
pn.Controls.Add(pp);
pn.SetColumn(pp, 0);
pn.SetRow(pp, pinfo.AuthenticationRequirements.Count);
pn.SetColumn(pp, 2);
panel.Controls.Add(pn);
panel.Controls.Add(pn);
}