本文整理汇总了C#中System.Windows.Forms.TabPage类的典型用法代码示例。如果您正苦于以下问题:C# TabPage类的具体用法?C# TabPage怎么用?C# TabPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TabPage类属于System.Windows.Forms命名空间,在下文中一共展示了TabPage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddTab
private void AddTab(string url, int? insertIndex = null)
{
browserTabControl.SuspendLayout();
var browser = new BrowserTabUserControl(url)
{
Dock = DockStyle.Fill,
};
var tabPage = new TabPage(url)
{
Dock = DockStyle.Fill
};
//This call isn't required for the sample to work.
//It's sole purpose is to demonstrate that #553 has been resolved.
browser.CreateControl();
tabPage.Controls.Add(browser);
if (insertIndex == null)
{
browserTabControl.TabPages.Add(tabPage);
}
else
{
browserTabControl.TabPages.Insert(insertIndex.Value, tabPage);
}
//Make newly created tab active
browserTabControl.SelectedTab = tabPage;
browserTabControl.ResumeLayout(true);
}
示例2: InitTabControlPages
private void InitTabControlPages()
{
foreach(var obj in CardLevels)
{
var page = new TabPage { Text = CardLevel.RoleCardLevelName(obj) };
CardTabControl.TabPages.Add(page);
var listData = new BindingList<RoleCard>();
var list = new ListBox()
{
Dock = DockStyle.Fill,
ContextMenuStrip = TabControlContextMenu,
DisplayMember = "Name",
ValueMember = "Id",
DataSource = listData,
};
list.SelectedIndexChanged += (sender, msg) =>
{
var item = list.SelectedItem as RoleCard;
if (ListOfRoleCardList[CardTabControl.SelectedIndex].Contains(item))
{
SelectedItem = item;
cardInfoControl1.BeginModify();
cardInfoControl1.Images = CardImageDictionary[SelectedItem.Id];
cardInfoControl1.RoleCard = SelectedItem;
cardInfoControl1.EndModify();
}
};
page.Controls.Add(list);
ListOfRoleCardList.Add(listData);
}
}
示例3: AddSource
public bool AddSource(string pathToSource, string title)
{
TabPage tpg = new TabPage(title);
bool fRez = true;
if (System.IO.File.Exists(pathToSource))
{
FileKeyValue fkv = new FileKeyValue(pathToSource);
fkv.Dock = DockStyle.Fill;
tpg.Controls.Add(fkv);
Sources.Add(title, pathToSource);
}
else
{
Label lbl = new Label();
lbl.TextAlign = ContentAlignment.MiddleCenter;
lbl.Text = "!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\r\nTHERE IS NO EQUIVALENT FILE\r\n\r\nPAY ATTENTION TO THIS ISSUE \r\n IF IT IS A DEFAULT TAB PAGE\r\n\r\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
lbl.Font = new System.Drawing.Font(this.Font, FontStyle.Bold);
lbl.ForeColor = Color.Red;
lbl.Padding = new System.Windows.Forms.Padding(100);
lbl.Dock = DockStyle.Fill;
tpg.BackColor = Color.LightPink;
tpg.Controls.Add(lbl);
fRez = false;
this.panel1.Padding = new Padding(10);
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.BackColor = Color.Red;
}
this.tabControl1.TabPages.Add(tpg);
return fRez;
}
示例4: InitializeRFGenTab
private void InitializeRFGenTab()
{
this.m_tabRFGen = new System.Windows.Forms.TabPage();
this.m_tabRFGen.SuspendLayout();
this.m_MainTab.Controls.Add(this.m_tabRFGen);
//
// m_tabRFGen
//
//this.m_tabRFGen.Controls.Add(this.m_groupControl_Commands);
//this.m_tabRFGen.Controls.Add(this.m_ReportTextBox);
this.m_tabRFGen.Location = new System.Drawing.Point(4, 26);
this.m_tabRFGen.Name = "m_tabRFGen";
this.m_tabRFGen.Padding = new System.Windows.Forms.Padding(3);
this.m_tabRFGen.Size = new System.Drawing.Size(1084, 510);
this.m_tabRFGen.TabIndex = 1;
this.m_tabRFGen.Text = "Signal Generator [BETA]";
this.m_tabRFGen.UseVisualStyleBackColor = true;
this.m_tabRFGen.Enter += new System.EventHandler(this.OnTabRFGen_Enter);
m_GraphTrackingGenerator = new ZedGraph.ZedGraphControl();
m_tabRFGen.Controls.Add(m_GraphTrackingGenerator);
InitializeTrackingGeneratorGraph();
}
示例5: AddTab
/// <summary>
/// 根据某个url添加界面
/// </summary>
/// <param name="url"></param>
/// <param name="insertIndex"></param>
private void AddTab(string url, int? insertIndex = null)
{
browerTabControl.SuspendLayout();
var brower = new UserControl1(url)
{
Dock=DockStyle.Fill,
};
var tabPage = new TabPage(url)
{
Dock = DockStyle.Fill
};
brower.CreateControl();
tabPage.Controls.Add(brower);
if (insertIndex == null)
{
browerTabControl.TabPages.Add(tabPage);
}
else
{
browerTabControl.TabPages.Insert(insertIndex.Value, tabPage);
}
browerTabControl.SelectedTab = tabPage;
browerTabControl.ResumeLayout(true);
}
示例6: MultipleGraphics
public MultipleGraphics(ResultResearch r)
{
InitializeComponent();
this.research = r;
SortedDictionary<double, SortedDictionary<double, SubGraphsInfo>>.KeyCollection keys =
this.research.Result.Keys;
foreach (double k in keys)
{
Chart graphic = new Chart();
graphic.Titles.Add("Network Size = " + this.research.Size.ToString());
ChartArea chArea = new ChartArea("Current Level = " + k.ToString());
chArea.AxisX.Title = "Mu";
chArea.AxisY.Title = "Order";
graphic.ChartAreas.Add(chArea);
Series s = new Series("Current Level = " + k.ToString());
s.ChartType = SeriesChartType.Line;
s.Color = Color.Red;
foreach (KeyValuePair<double, SubGraphsInfo> v in this.research.Result[k])
{
s.Points.Add(new DataPoint(v.Key, v.Value.avgOrder));
}
graphic.Series.Add(s);
graphic.Dock = DockStyle.Fill;
TabPage page = new TabPage("Current Level = " + k.ToString());
page.Controls.Add(graphic);
this.graphicsTab.TabPages.Add(page);
this.graphics.Add(graphic);
}
}
示例7: NumericUpDownActorsValueChanged
private void NumericUpDownActorsValueChanged(object sender, EventArgs e)
{
var value = (int)this.numericUpDownActors.Value;
if (value < this.tabControlActors.TabCount)
{
for (int i = this.tabControlActors.TabCount - 1; i >= value; i--)
{
this.tabControlActors.TabPages.RemoveAt(i);
Project.BTActors.RemoveAt(i);
}
}
else
{
this.tabControlActors.SuspendLayout();
for (int i = this.tabControlActors.TabCount; i < value; i++)
{
var page = new TabPage((i + 1).ToString(CultureInfo.InvariantCulture));
var panel = new BattleTestActorPanel();
page.Controls.Add(panel);
panel.Dock = DockStyle.Fill;
this.tabControlActors.TabPages.Add(page);
Project.BTActors.Add(Project.Data.Actors[0]);
}
this.tabControlActors.ResumeLayout(true);
}
}
示例8: Initialize
public override void Initialize ()
{
_textBox = new TextBox() {
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right,
Font = new Font("Courier New", 9F, FontStyle.Regular, GraphicsUnit.Point, 0),
Location = new Point(0, 0),
Margin = new Padding(0),
Multiline = true,
ScrollBars = ScrollBars.Vertical,
Size = new Size(500, 263),
TabIndex = 0,
MaxLength = 0,
};
_tabPage = new TabPage() {
Location = new Point(4, 22),
Padding = new Padding(3),
Size = new Size(500, 263),
TabIndex = 1,
Text = "Text View",
UseVisualStyleBackColor = true,
};
_tabPage.Controls.Add(_textBox);
_textBox.TextChanged += (s, e) => { OnModified(); RebuildElementIndex(); };
_textBox.PreviewKeyDown += (s, e) => { e.IsInputKey = true; };
_textBox.KeyUp += (s, e) => { UpdateElementLabel(); };
_textBox.MouseClick += (s, e) => { UpdateElementLabel(); };
InitializeStatusBar();
}
示例9: addVersionButton_Click
private void addVersionButton_Click(object sender, EventArgs e)
{
ItemVersion itemversion = item.NewItemVersion();
TabPage ctrl = new TabPage();
ctrl.Controls.Add(new ItemVersionCtrl(itemversion,ctrl));
itemVersionTabCtrl.TabPages.Add(ctrl);
}
示例10: MainFrm
public MainFrm()
{
InitializeComponent();
Text = GetVersionString();
LauncherHelper.LoadBanlist();
var loginTab = new TabPage("Login");
m_loginWindow = new LoginFrm();
loginTab.Controls.Add(m_loginWindow);
mainTabs.TabPages.Add(loginTab);
m_chatWindow = new ChatFrm();
GameWindow = new HubGameList_frm();
m_rankingWindow = new RankingFrm();
m_devpointWindow = new SupportFrm();
m_filemanagerWindow = new FileManagerFrm();
m_customizerWindow = new CustomizeFrm();
Program.ChatServer.ServerMessage += ServerMessage;
mainTabs.SelectedIndexChanged += TabChange;
ApplyTranslation();
}
示例11: InitData
private void InitData()
{
#region 生成按钮
foreach (var m in CommonHelper.ConfigHelper.Config.CategoryConfig.CategoryList)
{
TabPage tab = new TabPage(m.Name);
FlowLayoutPanel flowPanel = new FlowLayoutPanel();
flowPanel.Dock = DockStyle.Fill;
if (null != m.CategoryItemList && m.CategoryItemList.Count > 0)
{
for (int k = 0; k < m.CategoryItemList.Count; k++)
{
var model = m.CategoryItemList[k];
Button bt = new Button();
bt.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
bt.Name = model.AssemblyName;
bt.Text = model.Name;
bt.AutoSize = true;
bt.Height = 25;
bt.Margin = new System.Windows.Forms.Padding(5);
bt.Padding = new System.Windows.Forms.Padding(3);
bt.Click += new EventHandler(bt_Click);
bt.MouseEnter += new EventHandler(bt_MouseEnter);
bt.MouseLeave += new EventHandler(bt_MouseLeave);
flowPanel.Controls.Add(bt);
}
}
tab.Controls.Add(flowPanel);
this.tabMenu.TabPages.Add(tab);
}
#endregion 生成按钮
}
示例12: PropertiesForm
public PropertiesForm(Folder f)
{
InitializeComponent();
xFolder = f;
this.Text = "Properties -- " + f.Name;
groupBox4.Enabled = false;
groupBox1.Enabled = false;
LoadGeneral(f);
tabPage1.Click += new EventHandler(tabPage1_Click);
#if DEBUG
TabPage tabPage2 = new TabPage();
propertyGrid1.Dock = DockStyle.Fill;
tabPage2.Controls.Add(this.propertyGrid1);
tabPage2.Location = new System.Drawing.Point(4, 22);
tabPage2.Name = "tabPage2";
tabPage2.Padding = new System.Windows.Forms.Padding(3);
tabPage2.Size = new System.Drawing.Size(509, 320);
tabPage2.TabIndex = 1;
tabPage2.Text = "Entry";
tabPage2.UseVisualStyleBackColor = true;
tabControl1.TabPages.Add(tabPage2);
#endif
this.Load +=new EventHandler(PropertiesForm_Load);
}
示例13: LoadXML
public void LoadXML( FaceXML XML )
{
this.XML = XML;
this.tabControl1.Controls.Clear();
this.tabPage1.Controls.Clear();
this.tabControl1.Controls.Add( tabPage1 );
int width = tabPage1.Size.Width;
int height = tabPage1.Size.Height;
FaceImageListControl f = new FaceImageListControl( XML, this );
f.Size = new Size( width, height );
f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
this.tabPage1.Controls.Add( f );
AllFacesControl = f;
FaceControls = new Dictionary<string, FaceImageListControl>();
foreach ( KeyValuePair<String, List<FaceImage>> KVP in XML.Categories ) {
TabPage p = new TabPage( KVP.Key );
p.Size = new Size( width, height );
f = new FaceImageListControl( KVP.Key, KVP.Value, AllFacesControl, this );
f.Size = new Size( width, height );
f.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
p.Controls.Add( f );
this.tabControl1.Controls.Add( p );
FaceControls.Add( KVP.Key, f );
}
}
示例14: DrawMaxSum
public void DrawMaxSum(TabPage page)
{
int X = page.Width;
int Y = page.Height;
bt = new Button[row, col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
bt[i, j] = new Button();
bt[i, j].AutoSize = false;
bt[i, j].Text = Convert.ToString(map[i, j]);
bt[i, j].SetBounds(j * X / col, i * Y / row, X / col, Y / row);
bt[i, j].Visible = true;
page.Controls.Add(bt[i, j]);
}
}
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
if (mark[i, j] == 1)
{
bt[i, j].BackColor = Color.Yellow;
}
}
}
}
示例15: Form1
public Form1(string[] args)
{
this.Width = 800;
this.Height = 600;
InitializeComponent();
_tabs = new TabControl();
_tabs.Dock = DockStyle.Fill;
Controls.Add(_tabs);
var page = new TabPage("File0");
page.Width = _tabs.Width;
page.Height = Convert.ToInt32(_tabs.Height * 0.9);
string path = calc(args);
input(path);
sum = new int[row, col];
mark = new int[row, col];
ans = -INF;
MaxSum thismaxsum = new MaxSum(map, row, col, ref ans, ref mark, mode);
DrawMaxSum(page);
ShowMaxSum(page);
_tabs.SelectedTab = page;
_tabs.TabPages.Add(page);
}