本文整理汇总了C#中System.Windows.Forms.Control.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Control.Add方法的具体用法?C# Control.Add怎么用?C# Control.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Control
的用法示例。
在下文中一共展示了Control.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addTo
public void addTo(Control.ControlCollection controls)
{
controls.Add(depthTextBox);
controls.Add(statusLabel);
controls.Add(amountTextBox);
controls.Add(deleteCheckBox);
}
示例2: CheckBox
/// <summary>
/// Construct a new check box with no key button.
/// </summary>
/// <param name="location"></param>
/// <param name="name"></param>
/// <param name="isChecked"></param>
/// <param name="OnButtonChecked"></param>
/// <param name="OnButtonUnchecked"></param>
public CheckBox(
Control.ControlCollection controls,
Point location,
string name,
bool isChecked,
Lambda OnButtonChecked,
Lambda OnButtonUnchecked)
{
box = new System.Windows.Forms.CheckBox();
box.AutoSize = true;
box.Location = location;
box.Checked = isChecked;
box.Name = name;
box.Size = new System.Drawing.Size(80, 17);
box.TabIndex = 0;
box.Text = name;
box.UseVisualStyleBackColor = true;
// Anonymous checked event handler -- callback to provided lambdas for check/uncheck behavior.
box.CheckedChanged += delegate(Object sender, EventArgs e)
{
if (box.Checked)
{
OnButtonChecked();
}
else
{
OnButtonUnchecked();
}
};
controls.Add(box);
}
示例3: FormCubeLayerVisualiser
public FormCubeLayerVisualiser( Control.ControlCollection parentControl, Point location, guiOptions p_GuiOptions, MainForm mainForm )
{
int i = 0;
this.location = location;
this.GuiOptions = p_GuiOptions;
this.dataPanel = new System.Windows.Forms.Panel();
this.dataPanel.Location = location;
this.dataPanel.Name = "panel1";
this.dataPanel.Size = new System.Drawing.Size(320, 320);
parentControl.Add(dataPanel);
layerData = new PictureBox[100];
this.parentForm = mainForm;
for (i = 0; i < 100; i++)
{
this.layerData[i] = new PictureBox();
this.layerData[i].Image = global::FadeCube.Properties.Resources.led_0;
this.layerData[i].Location = new Point((i % 10) * 32, (i / 10) * 32);
this.layerData[i].Name = "layerData" + i.ToString();
this.layerData[i].Size = new System.Drawing.Size(32, 32);
this.layerData[i].TabIndex = 0;
this.layerData[i].TabStop = false;
this.layerData[i].SendToBack();
this.layerData[i].Click += new System.EventHandler(layerData_Click);
dataPanel.Controls.Add(layerData[i]);
}
}
示例4: CreateControl
public override Control CreateControl(IRuleControlOwner owner, Control.ControlCollection collection, System.Drawing.Point pos)
{
RuleControl rc = new RuleControl(owner) {Location = pos};
rc.RestoreFromRule(this);
DisposeControl();
ruleControl_ = rc;
collection.Add(rc);
return rc;
}
示例5: NumberFieldsTable
public NumberFieldsTable(Control.ControlCollection Controls, Point location)
{
Fields = new NumberField[SIZE, SIZE];
for (int i = 0; i < SIZE; i++)
for (int j = 0; j < SIZE; j++)
{
Fields[i, j] = new NumberField(i, j, location);
Controls.Add(Fields[i, j]);
}
}
示例6: CreateControls
public override void CreateControls(Control.ControlCollection collection)
{
selectButton = new Button();
selectButton.Width = 150;
selectButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SELECT);
selectButton.Enabled = false;
selectButton.Click += new EventHandler(importButton_Click);
collection.Add(selectButton);
}
示例7: CreateControls
public override void CreateControls(Control.ControlCollection collection)
{
reworkButton = new Button();
reworkButton.Width = 150;
reworkButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_REWORK);
reworkButton.Enabled = false;
reworkButton.Click += new EventHandler(reworkButton_Click);
collection.Add(reworkButton);
}
示例8: Add
private static int Add(Control.ControlCollection Instance,IntPtr l)
{
// get method arguments
int valueId = (int)LuaApi.lua_tonumber(l,3);
Control value = LuaManager.Instance.GetObjectT<Control>(valueId);
// call method
Instance.Add(value);
return 0;
}
示例9: addButton
/// <summary>
/// 动态增加一个button,指定显示的文本和点击事件执行的委托
/// </summary>
/// <param name="Controls1">要增加的控件集合</param>
/// <param name="text">button文本</param>
/// <param name="buttonClickHandler1">绑定点击后执行的委托</param>
/// <returns></returns>
public Button addButton(Control.ControlCollection Controls1, string text,int buttonWidth,int buttonHeight, buttonClickHandler buttonClickHandler1)
{
Button Button1 = new Button();
Button1.Text = text;
Button1.Size = new Size(buttonWidth, buttonHeight);
Button1.Click += (sender,e) =>
{
buttonClickHandler1(sender,e);
};
Controls1.Add(Button1);
return Button1;
}
示例10: displayFormOnPanel
public static void displayFormOnPanel(Control.ControlCollection control, Form newForm)
{
bool isExist = control.Contains(newForm);
if (isExist == false)
{
newForm.TopLevel = false; //设置为非顶级窗体
newForm.FormBorderStyle = FormBorderStyle.None; //设置窗体为非边框样式
newForm.Dock = System.Windows.Forms.DockStyle.Fill; //设置样式是否填充整个PANEL
control.Add(newForm); //添加窗体
newForm.Show();
}
newForm.BringToFront();
}
示例11: MainTabControlDrawing
private TabControl MainTabControlDrawing(Control.ControlCollection Controls)
{
TabControl MainTabControl = new TabControl();
// 配置位置を設定
MainTabControl.Location = new System.Drawing.Point(10, 10);
// Nameプロパティを設定
MainTabControl.Name = "tabControl";
// 選択されているタブページのインデックス取得
MainTabControl.SelectedIndex = 0;
// サイズを設定
MainTabControl.Size = new System.Drawing.Size(340, 585);
// TabIndexを設定
MainTabControl.TabIndex = 0;
//MainTab表示
Controls.Add(MainTabControl);
return MainTabControl;
}
示例12: World
// The World constructor receives a reference to the Controls object so
// it can add window elements (labels in this case) to the main screen
public World(Control.ControlCollection controls, Color backColor,
int rows, int columns, int colWidth, int rowHeight)
{
this.rows = rows;
this.columns = columns;
this.backColor = backColor;
tiles = new Tile[rows, columns];
for (int row = 0; row < rows; row++)
{
for (int col = 0; col < columns; col++)
{
tiles[row, col].label = new Label();
tiles[row, col].label.AutoSize = false;
tiles[row, col].label.BorderStyle = BorderStyle.FixedSingle;
tiles[row, col].label.Location = new Point(col * colWidth, row * rowHeight);
tiles[row, col].label.Size = new Size(colWidth, rowHeight);
controls.Add(tiles[row, col].label);
}
}
}
示例13: RelationshipView
public RelationshipView(Control.ControlCollection collection, Essenishial one, Essenishial two,
ErRelationshipConnectType firsType, ErRelationshipConnectType secType,
ErDiagram Diagram
)
{
targetDiagram = Diagram;
ErConnectEssencePair firstPair = new ErConnectEssencePair(one.Essence, firsType);
ErConnectEssencePair secondPair = new ErConnectEssencePair(two.Essence, secType);
targetRelationship = new ErRelationship(firstPair, secondPair);
targetDiagram.AddRelationship(targetRelationship);
oneEssenishial = one;
twoEssenishial = two;
one.OneOrTwoList.Add(1);
two.OneOrTwoList.Add(2);
OnePoint = one.GetCentralPoint();
TwoPoint = two.GetCentralPoint();
one.RelationshipViewList.Add(this);
two.RelationshipViewList.Add(this);
MiddlePoint = new Point((OnePoint.X + TwoPoint.X) / 2, (OnePoint.Y + TwoPoint.Y) / 2);
containerOne = new ShapeContainer();
OneToMiddleLine = new LineShape(OnePoint.X, OnePoint.Y, MiddlePoint.X, MiddlePoint.Y);
OneToMiddleLine.DoubleClick += OpenRelationshipEditorWindow;
OneToMiddleLine.BorderWidth = 3;
OneToMiddleLine.BorderStyle = GetLineStyle(firsType.ModalType);
MiddelToTwoLine = new LineShape(MiddlePoint.X, MiddlePoint.Y, TwoPoint.X, TwoPoint.Y);
MiddelToTwoLine.BorderWidth = 3;
MiddelToTwoLine.DoubleClick += OpenRelationshipEditorWindow;
MiddelToTwoLine.BorderStyle = GetLineStyle(secType.ModalType);
containerOne.Shapes.Add(OneToMiddleLine);
containerOne.Shapes.Add(MiddelToTwoLine);
//shape.
collection.Add(containerOne);
}
示例14: shoot
public override Bullet shoot(Control.ControlCollection controls)
{
int xPos = 0, yPos = 0;
switch (direction)
{
case Direction.Up:
xPos = x + width / 2 - Bullet.width / 2;
yPos = y;
break;
case Direction.Down:
xPos = x + width / 2 - Bullet.width / 2;
yPos = y + height;
break;
case Direction.Left:
xPos = x;
yPos = y + height / 2 - Bullet.height / 2;
break;
case Direction.Right:
xPos = x + width;
yPos = y + height / 2 - Bullet.height / 2;
break;
}
Bullet bullet = new Bullet(xPos, yPos, direction);
controls.Add(bullet.picture);
return bullet;
}
示例15: NewControl
public static void NewControl(Control.ControlCollection controls, ref UserControl oldControl, UserControl newControl)
{
controls.Remove(oldControl);
oldControl = newControl;
controls.Add(oldControl);
}