本文整理汇总了C#中Panel.Init方法的典型用法代码示例。如果您正苦于以下问题:C# Panel.Init方法的具体用法?C# Panel.Init怎么用?C# Panel.Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel.Init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TaskAutoScroll
public TaskAutoScroll(Manager manager)
: base(manager) {
Height = 360;
MinimumHeight = 99;
MinimumWidth = 78;
Text = "Auto Scrolling";
Center();
pnl1 = new Panel(manager);
pnl1.Init();
pnl1.Parent = this;
pnl1.Width = 400;
pnl1.Height = 180;
pnl1.Left = 20;
pnl1.Top = 20;
pnl1.BevelBorder = EBevelBorder.All;
pnl1.BevelStyle = EBevelStyle.Flat;
pnl1.BevelMargin = 1;
pnl1.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
pnl1.AutoScroll = true;
pnl2 = new Panel(manager);
pnl2.Init();
pnl2.Parent = this;
pnl2.Width = 400;
pnl2.Height = 320;
pnl2.Left = 40;
pnl2.Top = 80;
pnl2.BevelBorder = EBevelBorder.All;
pnl2.BevelStyle = EBevelStyle.Flat;
pnl2.BevelMargin = 1;
pnl2.Text = "2";
pnl2.Anchor = EAnchors.Left | EAnchors.Top;
pnl2.Color = Color.White;
}
示例2: Dialog
/// <summary>
/// Creates a new dialog window.
/// </summary>
/// <param name="manager">GUI manager for the dialog window.</param>
public Dialog(Manager manager)
: base(manager)
{
// Create the top panel control.
pnlTop = new Panel(manager);
pnlTop.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
pnlTop.Init();
pnlTop.Parent = this;
pnlTop.Width = ClientWidth;
pnlTop.Height = 64;
pnlTop.BevelBorder = BevelBorder.Bottom;
// Create the caption label and add it to the top panel.
lblCapt = new Label(manager);
lblCapt.Init();
lblCapt.Parent = pnlTop;
lblCapt.Width = lblCapt.Parent.ClientWidth - 16;
lblCapt.Text = "Caption";
lblCapt.Left = 8;
lblCapt.Top = 8;
lblCapt.Alignment = Alignment.TopLeft;
lblCapt.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
// Create the description label and add it to the top panel.
lblDesc = new Label(manager);
lblDesc.Init();
lblDesc.Parent = pnlTop;
lblDesc.Width = lblDesc.Parent.ClientWidth - 16;
lblDesc.Left = 8;
lblDesc.Text = "Description text.";
lblDesc.Alignment = Alignment.TopLeft;
lblDesc.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
// Create the bottom panel control.
pnlBottom = new Panel(manager);
pnlBottom.Init();
pnlBottom.Parent = this;
pnlBottom.Width = ClientWidth;
pnlBottom.Height = 24 + 16;
pnlBottom.Top = ClientHeight - pnlBottom.Height;
pnlBottom.BevelBorder = BevelBorder.Top;
pnlBottom.Anchor = Anchors.Left | Anchors.Bottom | Anchors.Right;
}
示例3: Dialog
public Dialog(Manager manager)
: base(manager) {
pnlTop = new Panel(manager);
pnlTop.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
pnlTop.Init();
pnlTop.Parent = this;
pnlTop.Width = ClientWidth;
pnlTop.Height = 64;
pnlTop.BevelBorder = EBevelBorder.Bottom;
lblCapt = new Label(manager);
lblCapt.Init();
lblCapt.Parent = pnlTop;
lblCapt.Width = lblCapt.Parent.ClientWidth - 16;
lblCapt.Text = "Caption";
lblCapt.Left = 8;
lblCapt.Top = 8;
lblCapt.Alignment = EAlignment.TopLeft;
lblCapt.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
lblDesc = new Label(manager);
lblDesc.Init();
lblDesc.Parent = pnlTop;
lblDesc.Width = lblDesc.Parent.ClientWidth - 16;
lblDesc.Left = 8;
lblDesc.Text = "Description text.";
lblDesc.Alignment = EAlignment.TopLeft;
lblDesc.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
pnlBottom = new Panel(manager);
pnlBottom.Init();
pnlBottom.Parent = this;
pnlBottom.Width = ClientWidth;
pnlBottom.Height = 24 + 16;
pnlBottom.Top = ClientHeight - pnlBottom.Height;
pnlBottom.BevelBorder = EBevelBorder.Top;
pnlBottom.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right;
}
示例4: AddNews
private void AddNews(string author, string date, string title, string message, int num) {
GroupPanel newsPnl = ScreenManager.MainWindow.ClientArea.Controls["InsaneRO News"] as GroupPanel;
Panel pnl = new Panel(WindowManager);
pnl.Init();
pnl.Text = "News_" + num;
pnl.Tag = num;
pnl.Width = newsPnl.ClientWidth - 20;
pnl.Height = 210;
pnl.Left = 10;
pnl.Top = (num * 10) + (num * 210) + 10;
pnl.BevelBorder = EBevelBorder.All;
pnl.BevelMargin = 1;
pnl.BevelStyle = EBevelStyle.Flat;
pnl.Color = Color.Transparent;
pnl.Passive = true;
Label lblTitle = new Label(WindowManager);
lblTitle.Init();
lblTitle.Skin.Layers[0].Text.Font.Resource = WindowManager.Skin.Fonts[WindowManager.Skin.Controls["Dialog"].Layers["TopPanel"].Attributes["CaptFont"].Value].Resource;
lblTitle.Text = "'" + title + "' - Von " + author + " (" + date + ")";
lblTitle.TextColor = new Color(81, 172, 232);
lblTitle.Top = 5;
lblTitle.Left = 5;
lblTitle.Width = pnl.ClientWidth - 15;
lblTitle.Height = 24;
lblTitle.Alignment = EAlignment.TopLeft;
pnl.Add(lblTitle);
Label lblMessage = new Label(WindowManager);
lblMessage.Init();
lblMessage.Text = "";
lblMessage.TextLines.AddRange(message.Split(new string[] { Environment.NewLine }, StringSplitOptions.None));
lblMessage.Top = 5 + 5 + 24;
lblMessage.Left = 10;
lblMessage.Width = pnl.ClientWidth - 20;
lblMessage.Height = pnl.ClientHeight - 15 - 24;
lblMessage.Ellipsis = false;
lblMessage.Alignment = EAlignment.TopLeft;
lblMessage.Autosize = true;
lblMessage.Draw += new DrawEventHandler(lblMessage_Draw);
pnl.Add(lblMessage);
newsPnl.Add(pnl);
}
示例5: TaskControls
public TaskControls(Manager manager)
: base(manager) {
MinimumWidth = 340;
MinimumHeight = 140;
Height = 480;
Center();
Text = "Controls Test";
TopPanel.Visible = true;
Caption.Text = "Information";
Description.Text = "Demonstration of various controls available in Window Library";
Caption.TextColor = Description.TextColor = new Color(96, 96, 96);
grpEdit = new GroupPanel(Manager);
grpEdit.Init();
grpEdit.Parent = this;
grpEdit.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
grpEdit.Width = ClientWidth - 200;
grpEdit.Height = 160;
grpEdit.Left = 8;
grpEdit.Top = TopPanel.Height + 8;
grpEdit.Text = "EditBox";
pnlControls = new Panel(Manager);
pnlControls.Init();
pnlControls.Passive = true;
pnlControls.Parent = this;
pnlControls.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right;
pnlControls.Left = 8;
pnlControls.Top = grpEdit.Top + grpEdit.Height + 8;
pnlControls.Width = ClientWidth - 200;
pnlControls.Height = BottomPanel.Top - 32 - pnlControls.Top;
pnlControls.BevelBorder = EBevelBorder.All;
pnlControls.BevelMargin = 1;
pnlControls.BevelStyle = EBevelStyle.Etched;
pnlControls.Color = Color.Transparent;
lblEdit = new Label(manager);
lblEdit.Init();
lblEdit.Parent = grpEdit;
lblEdit.Left = 16;
lblEdit.Top = 8;
lblEdit.Text = "Testing field:";
lblEdit.Width = 128;
lblEdit.Height = 16;
txtEdit = new TextBox(manager);
txtEdit.Init();
txtEdit.Parent = grpEdit;
txtEdit.Left = 16;
txtEdit.Top = 24;
txtEdit.Width = grpEdit.ClientWidth - 32;
txtEdit.Height = 20;
txtEdit.Anchor = EAnchors.Left | EAnchors.Top | EAnchors.Right | EAnchors.Bottom;
txtEdit.Text = "Text";
rdbNormal = new RadioButton(manager);
rdbNormal.Init();
rdbNormal.Parent = grpEdit;
rdbNormal.Left = 16;
rdbNormal.Top = 52;
rdbNormal.Width = grpEdit.ClientWidth - 32;
rdbNormal.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right;
rdbNormal.Checked = true;
rdbNormal.Text = "Normal mode";
rdbNormal.ToolTip.Text = "Enables normal mode for TextBox control.";
rdbNormal.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(ModeChanged);
rdbPassword = new RadioButton(manager);
rdbPassword.Init();
rdbPassword.Parent = grpEdit;
rdbPassword.Left = 16;
rdbPassword.Top = 68;
rdbPassword.Width = grpEdit.ClientWidth - 32;
rdbPassword.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right;
rdbPassword.Checked = false;
rdbPassword.Text = "Password mode";
rdbPassword.ToolTip.Text = "Enables password mode for TextBox control.";
rdbPassword.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(ModeChanged);
chkBorders = new CheckBox(manager);
chkBorders.Init();
chkBorders.Parent = grpEdit;
chkBorders.Left = 16;
chkBorders.Top = 96;
chkBorders.Width = grpEdit.ClientWidth - 32;
chkBorders.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right;
chkBorders.Checked = false;
chkBorders.Text = "Borderless mode";
chkBorders.ToolTip.Text = "Enables or disables borderless mode for TextBox control.";
chkBorders.CheckedChanged += new GodLesZ.Library.XNA.WindowLibrary.Controls.EventHandler(chkBorders_CheckedChanged);
chkReadOnly = new CheckBox(manager);
chkReadOnly.Init();
chkReadOnly.Parent = grpEdit;
chkReadOnly.Left = 16;
chkReadOnly.Top = 110;
chkReadOnly.Width = grpEdit.ClientWidth - 32;
chkReadOnly.Anchor = EAnchors.Left | EAnchors.Bottom | EAnchors.Right;
chkReadOnly.Checked = false;
//.........这里部分代码省略.........