本文整理汇总了C#中TabControl.Init方法的典型用法代码示例。如果您正苦于以下问题:C# TabControl.Init方法的具体用法?C# TabControl.Init怎么用?C# TabControl.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TabControl
的用法示例。
在下文中一共展示了TabControl.Init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public override void Initialize() {
base.Initialize();
string[] actions = new string[]{
"Gegner suchen",
"Deck bearbeiten",
"noch ne Aktion",
"Und noch eine",
"keine Ahnung",
"Ficken?",
"Ok o.o",
"blubb",
"foo",
"bar",
"moepse sin toll",
};
// just to refresh
ScreenManager.MainWindow.BringToFront();
#region Links - Übersicht
GroupPanel wnd = new GroupPanel(WindowManager);
wnd.Init();
wnd.Text = "Übersicht";
wnd.TextColor = Color.LightGray;
wnd.Width = 200;
wnd.Height = ScreenManager.MainWindow.ClientHeight - 40;
wnd.Top = 20;
wnd.Left = 20;
wnd.Visible = true;
// Actions
int btnWidth = 160;
int btnHeight = 40;
Button btn;
for (int i = 0; i < actions.Length; i++) {
btn = new Button(WindowManager);
btn.Init();
btn.Width = btnWidth;
btn.Height = btnHeight;
btn.Left = 20;
btn.Top = ((i * 20) + btnHeight * i) + 20;
btn.Text = actions[i];
btn.Click += new WindowLibrary.Controls.EventHandler(ActionButton_Click);
btn.Tag = i;
wnd.Add(btn);
}
AddWindow(wnd);
#endregion
#region Rechts - Spiele & Statistik
GroupPanel runingGamesPanel = new GroupPanel(WindowManager);
runingGamesPanel.Init();
runingGamesPanel.Text = "Laufende Spiele";
runingGamesPanel.TextColor = Color.LightGray;
runingGamesPanel.Width = 200;
runingGamesPanel.Height = 400;
runingGamesPanel.Top = 20;
runingGamesPanel.Left = ScreenManager.MainWindow.ClientWidth - runingGamesPanel.Width - 20;
runingGamesPanel.Visible = true;
AddWindow(runingGamesPanel);
GroupPanel statPanel = new GroupPanel(WindowManager);
statPanel.Init();
statPanel.Text = "Statistik";
statPanel.TextColor = Color.LightGray;
statPanel.Width = 200;
statPanel.Height = ScreenManager.MainWindow.ClientHeight - 460;
statPanel.Top = 440;
statPanel.Left = ScreenManager.MainWindow.ClientWidth - statPanel.Width - 20;
statPanel.Visible = true;
AddWindow(statPanel);
#endregion
#region Mitte - Chat
TabControl tbc = new TabControl(WindowManager);
mConsole = new WindowLibrary.Controls.Console(WindowManager);
tbc.Init();
tbc.AddPage("Allgemein");
tbc.Alpha = 200;
tbc.Left = 240;
tbc.Height = 220;
tbc.Width = ScreenManager.MainWindow.ClientWidth - 480;
tbc.Top = ScreenManager.MainWindow.ClientHeight - tbc.Height - 18;
tbc.Movable = false;
tbc.Resizable = false;
tbc.MinimumHeight = 96;
tbc.MinimumWidth = 160;
tbc.TabPages[0].Add(mConsole);
mConsole.Init();
mConsole.Width = tbc.TabPages[0].ClientWidth;
mConsole.Height = tbc.TabPages[0].ClientHeight;
mConsole.Anchor = EAnchors.All;
//.........这里部分代码省略.........
示例2: TaskDialog
public TaskDialog(Manager manager)
: base(manager) {
//Alpha = 200;
Height = 520;
MinimumWidth = 254;
MinimumHeight = 160;
Center();
TopPanel.Height = 80;
TopPanel.BevelStyle = EBevelStyle.None;
TopPanel.BevelBorder = EBevelBorder.None;
Caption.Visible = false;
Description.Visible = false;
Text = "Dialog Template";
imgTop = new ImageBox(manager);
imgTop.Init();
imgTop.Parent = TopPanel;
imgTop.Top = 0;
imgTop.Left = 0;
imgTop.Width = TopPanel.ClientWidth;
imgTop.Height = TopPanel.ClientHeight;
imgTop.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right | EAnchors.Bottom;
imgTop.SizeMode = ESizeMode.Normal;
imgTop.Image = Manager.Content.Load<Texture2D>("Content\\Images\\Caption");
tbcMain = new TabControl(manager);
tbcMain.Init();
tbcMain.Parent = this;
tbcMain.Left = 4;
tbcMain.Top = TopPanel.Height + 4;
tbcMain.Width = ClientArea.Width - 8;
tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height;
tbcMain.Anchor = EAnchors.All;
tbcMain.AddPage();
tbcMain.TabPages[0].Text = "First";
tbcMain.AddPage();
tbcMain.TabPages[1].Text = "Second";
tbcMain.AddPage();
tbcMain.TabPages[2].Text = "Third";
btnFirst = new Button(manager);
btnFirst.Init();
btnFirst.Parent = tbcMain.TabPages[0];
btnFirst.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
btnFirst.Top = 8;
btnFirst.Left = 8;
btnFirst.Width = btnFirst.Parent.ClientWidth - 16;
btnFirst.Text = ">>> First Page Button <<<";
grpFirst = new GroupPanel(manager);
grpFirst.Init();
grpFirst.Parent = tbcMain.TabPages[0];
grpFirst.Anchor = EAnchors.All;
//grpFirst.Type = GroupBoxType.Flat;
grpFirst.Left = 8;
grpFirst.Top = btnFirst.Top + btnFirst.Height + 4;
grpFirst.Width = btnFirst.Parent.ClientWidth - 16;
grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8;
btnSecond = new Button(manager);
btnSecond.Init();
btnSecond.Parent = tbcMain.TabPages[1];
btnSecond.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
btnSecond.Top = 8;
btnSecond.Left = 8;
btnSecond.Width = btnSecond.Parent.ClientWidth - 16;
btnSecond.Text = ">>> Second Page Button <<<";
btnThird = new Button(manager);
btnThird.Init();
btnThird.Parent = tbcMain.TabPages[2];
btnThird.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
btnThird.Top = 8;
btnThird.Left = 8;
btnThird.Width = btnThird.Parent.ClientWidth - 16;
btnThird.Text = ">>> Third Page Button <<<";
btnOk = new Button(manager);
btnOk.Init();
btnOk.Parent = BottomPanel;
btnOk.Anchor = EAnchors.Top | EAnchors.Right;
btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8;
btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8;
btnOk.Text = "OK";
btnOk.ModalResult = EModalResult.Ok;
btnApply = new Button(manager);
btnApply.Init();
btnApply.Parent = BottomPanel;
btnApply.Anchor = EAnchors.Top | EAnchors.Right;
btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8;
btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8;
btnApply.Text = "Apply";
btnClose = new Button(manager);
btnClose.Init();
btnClose.Parent = BottomPanel;
btnClose.Anchor = EAnchors.Top | EAnchors.Right;
btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8;
//.........这里部分代码省略.........
示例3: InitConsole
private void InitConsole() {
TabControl tbc = new TabControl(Manager);
Console con1 = new Console(Manager);
Console con2 = new Console(Manager);
// Setup of TabControl, which will be holding both consoles
tbc.Init();
tbc.AddPage("Global");
tbc.AddPage("Private");
tbc.Alpha = 220;
tbc.Left = 220;
tbc.Height = 220;
tbc.Width = 400;
tbc.Top = Manager.TargetHeight - tbc.Height - 32;
tbc.Movable = true;
tbc.Resizable = true;
tbc.MinimumHeight = 96;
tbc.MinimumWidth = 160;
tbc.TabPages[0].Add(con1);
tbc.TabPages[1].Add(con2);
con1.Init();
con2.Init();
con2.Width = con1.Width = tbc.TabPages[0].ClientWidth;
con2.Height = con1.Height = tbc.TabPages[0].ClientHeight;
con2.Anchor = con1.Anchor = EAnchors.All;
con1.Channels.Add(new ConsoleChannel(0, "General", Color.Orange));
con1.Channels.Add(new ConsoleChannel(1, "Private", Color.White));
con1.Channels.Add(new ConsoleChannel(2, "System", Color.Yellow));
// We want to share channels and message buffer in both consoles
con2.Channels = con1.Channels;
con2.MessageBuffer = con1.MessageBuffer;
// In the second console we display only "Private" messages
con2.ChannelFilter.Add(1);
// Select default channels for each tab
con1.SelectedChannel = 0;
con2.SelectedChannel = 1;
// Do we want to add timestamp or channel name at the start of every message?
con1.MessageFormat = EConsoleMessageFormats.All;
con2.MessageFormat = EConsoleMessageFormats.TimeStamp;
// Handler for altering incoming message
con1.MessageSent += new ConsoleMessageEventHandler(con1_MessageSent);
// We send initial welcome message to System channel
con1.MessageBuffer.Add(new ConsoleMessage("Window Library Test!", 2));
Manager.Add(tbc);
}