本文整理汇总了C#中System.Windows.Forms.TabPage.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# TabPage.BringToFront方法的具体用法?C# TabPage.BringToFront怎么用?C# TabPage.BringToFront使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TabPage
的用法示例。
在下文中一共展示了TabPage.BringToFront方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: openToolStripMenuItem_Click
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.Filter = filter.ToString();
if (op.ShowDialog() == DialogResult.OK)
{
if (((TextBox)tabControl.SelectedTab.Controls[0]).Text.Length > 0)
{
TabPage tb = new TabPage();
TextBox tx = new TextBox();
tx.Font = MaintextBox.Font;
tx.ScrollBars = ScrollBars.Both;
tx.TextChanged += (MaintextBox_TextChanged_1);
tx.Dock = DockStyle.Fill;
tx.Multiline = true;
tb.Text = "untitled";
tb.Controls.Add(tx);
tabControl.Controls.Add(tb);
tb.BringToFront();
tb.Select();
tb.PerformLayout();
using (System.IO.StreamReader sr = new System.IO.StreamReader(op.FileName))
{
tx.Text = (sr.ReadToEnd());
sr.Dispose();
}
}
else
{
using (System.IO.StreamReader sr = new System.IO.StreamReader(op.FileName))
{
((TextBox)tabControl.SelectedTab.Controls[0]).Text = (sr.ReadToEnd());
tabControl.SelectedTab.Text = op.FileName;
sr.Dispose();
}
}
}
}
示例2: newTabToolStripMenuItem_Click
private void newTabToolStripMenuItem_Click(object sender, EventArgs e)
{
TabPage tb = new TabPage();
TextBox tx = new TextBox();
tx.Font = MaintextBox.Font;
tx.ScrollBars = ScrollBars.Both;
tx.TextChanged += (MaintextBox_TextChanged_1);
tx.Dock = DockStyle.Fill;
tx.Multiline = true;
tb.Text = "untitled";
tb.Controls.Add(tx);
tabControl.Controls.Add(tb);
tb.BringToFront();
tb.Select();
tb.PerformLayout();
}