本文整理汇总了C#中ListBox.Init方法的典型用法代码示例。如果您正苦于以下问题:C# ListBox.Init方法的具体用法?C# ListBox.Init怎么用?C# ListBox.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListBox
的用法示例。
在下文中一共展示了ListBox.Init方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TaskEvents
public TaskEvents(Manager manager)
: base(manager) {
Height = 360;
MinimumHeight = 99;
MinimumWidth = 78;
Text = "Events Test";
Center();
btn = new Button(manager);
btn.Init();
btn.Parent = this;
btn.Left = 20;
btn.Top = 20;
btn.MouseMove += new MouseEventHandler(btn_MouseMove);
btn.MouseDown += new MouseEventHandler(btn_MouseDown);
btn.MouseUp += new MouseEventHandler(btn_MouseUp);
btn.MouseOver += new MouseEventHandler(btn_MouseOver);
btn.MouseOut += new MouseEventHandler(btn_MouseOut);
btn.MousePress += new MouseEventHandler(btn_MousePress);
btn.Click += new EventHandler(btn_Click);
lst = new ListBox(manager);
lst.Init();
lst.Parent = this;
lst.Left = 20;
lst.Top = 60;
lst.Width = 128;
lst.Height = 128;
lst.MouseMove += new MouseEventHandler(btn_MouseMove);
lst.MouseDown += new MouseEventHandler(btn_MouseDown);
lst.MouseUp += new MouseEventHandler(btn_MouseUp);
lst.MouseOver += new MouseEventHandler(btn_MouseOver);
lst.MouseOut += new MouseEventHandler(btn_MouseOut);
lst.MousePress += new MouseEventHandler(btn_MousePress);
lst.Click += new EventHandler(btn_Click);
txt = new ListBox(manager);
txt.Init();
txt.Parent = this;
txt.Left = 200;
txt.Top = 8;
txt.Width = 160;
txt.Height = 300;
}
示例2: AboutModsPanel
public AboutModsPanel(Panel containingPanel, IModManager modManager, int desiredHeight = 500, int desiredWidth = 750)
{
_modManager = modManager;
ModListBox = new ListBox(containingPanel.Manager);
ModListBox.Init();
ModListBox.Top = ModListBox.Margins.Top;
ModListBox.Left = ModListBox.Margins.Left;
ModListBox.Width = 250;
ModListBox.Height = desiredHeight - containingPanel.ClientMargins.Vertical - ModListBox.Top - ModListBox.Margins.Bottom;
ModListBox.HideSelection = false;
ModListBox.c81fb310624c15a101535d14adc9ec383.Add("Gnomodia");
ModListBox.ItemIndexChanged += ModListBoxOnItemIndexChanged;
foreach (var modMetadata in modManager.ModMetadata)
{
ModListBox.c81fb310624c15a101535d14adc9ec383.Add(modMetadata.Name);
}
containingPanel.Add(ModListBox);
ModInfoPanel = new LoweredPanel(containingPanel.Manager);
ModInfoPanel.Init();
ModInfoPanel.Left = ModListBox.Left + ModListBox.Width + ModListBox.Margins.Right + ModInfoPanel.Margins.Left;
ModInfoPanel.Top = ModInfoPanel.Margins.Top;
ModInfoPanel.Width = desiredWidth - ModInfoPanel.Left - ModInfoPanel.Margins.Right;
ModInfoPanel.Height = desiredHeight - containingPanel.ClientMargins.Vertical - ModInfoPanel.Top - ModInfoPanel.Margins.Bottom;
ModInfoPanel.AutoScroll = true;
ModInfoPanel.HorizontalScrollBarEnabled = false;
ModInfoPanel.VerticalScrollBarShow = true;
containingPanel.Add(this.ModInfoPanel);
_titleLabel = new Label(containingPanel.Manager);
_titleLabel.Init();
_titleLabel.Top = _titleLabel.Margins.Top;
_titleLabel.Left = _titleLabel.Margins.Left;
_titleLabel.Height = 14;
_titleLabel.Width = ModInfoPanel.ClientWidth - _titleLabel.Margins.Horizontal;
_titleLabel.Text = "";
ModInfoPanel.Add(_titleLabel);
_versionLabel = new Label(containingPanel.Manager);
_versionLabel.Init();
_versionLabel.Left = _versionLabel.Margins.Left;
_versionLabel.Height = 14;
_versionLabel.Width = ModInfoPanel.Width - _versionLabel.Margins.Horizontal;
_versionLabel.Top = _titleLabel.Top + _titleLabel.Height + _titleLabel.Margins.Bottom + _versionLabel.Margins.Top;
_versionLabel.Text = "";
ModInfoPanel.Add(_versionLabel);
_authorLabel = new Label(containingPanel.Manager);
_authorLabel.Init();
_authorLabel.Left = _authorLabel.Margins.Left;
_authorLabel.Height = 14;
_authorLabel.Width = ModInfoPanel.Width - _authorLabel.Margins.Horizontal;
_authorLabel.Top = _versionLabel.Top + _versionLabel.Height + _versionLabel.Margins.Bottom + _authorLabel.Margins.Top;
_authorLabel.Text = "";
ModInfoPanel.Add(_authorLabel);
_infoLabel = new MultilineLabel(containingPanel.Manager);
_infoLabel.Left = _infoLabel.Margins.Left;
_infoLabel.Height = 0;
_infoLabel.Top = _authorLabel.Top + _authorLabel.Height + _authorLabel.Margins.Bottom + _infoLabel.Margins.Top;
_infoLabel.Width = ModInfoPanel.ClientWidth - _infoLabel.Margins.Horizontal;
_infoLabel.Anchor = Anchors.Top | Anchors.Left | Anchors.Right;
_infoLabel.Alignment = Alignment.TopLeft;
ModInfoPanel.Add(_infoLabel);
ModListBox.ItemIndex = 0;
}
示例3: ComboBox
public ComboBox(Manager manager)
: base(manager) {
Height = 20;
Width = 64;
ReadOnly = true;
btnDown = new Button(Manager);
btnDown.Init();
btnDown.Skin = new SkinControl(Manager.Skin.Controls["ComboBox.Button"]);
btnDown.CanFocus = false;
btnDown.Click += new EventHandler(btnDown_Click);
Add(btnDown, false);
lstCombo = new ListBox(Manager);
lstCombo.Init();
lstCombo.HotTrack = true;
lstCombo.Detached = true;
lstCombo.Visible = false;
lstCombo.Click += new EventHandler(lstCombo_Click);
lstCombo.FocusLost += new EventHandler(lstCombo_FocusLost);
lstCombo.Items = items;
manager.Input.MouseDown += new MouseEventHandler(Input_MouseDown);
}
示例4: 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;
//.........这里部分代码省略.........