本文整理汇总了C#中System.Windows.Forms.Label.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# Label.Hide方法的具体用法?C# Label.Hide怎么用?C# Label.Hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Label
的用法示例。
在下文中一共展示了Label.Hide方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Change
/// <summary>
/// Changes data of an existing Kunde/Kontakt
/// </summary>
/// <param name="k">The to-be-changed Kunde/Kontakt</param>
/// <param name="errorlabel">The label in which errormessages may be written</param>
public void Change(KundeKontaktTable k, Label errorlabel)
{
errorlabel.Hide();
IRule lnhsv = new LettersNumbersHyphenSpaceValidator();
IRule lhv = new LettersHyphenValidator();
IRule lengthv = new StringLength150Validator();
DataBindingFramework.BindFromString(k.Vorname, "Vorname", errorlabel, true, lhv, lengthv);
DataBindingFramework.BindFromString(k.NachnameFirmenname, "Nachname", errorlabel, false, lnhsv, lengthv);
if (errorlabel.Visible)
{
throw new InvalidInputException();
}
// else save new Kunde or Kontakt in database
if (k.Vorname.Length == 0)
{
this.logger.Log(Logger.Level.Info, "No first name will be stored.");
}
this.logger.Log(Logger.Level.Info, "User requested to change " + (k.Type == false ? "Kunde" : "Kontakt") + " with ID " + k.ID);
// Update data
try
{
DALFactory.GetDAL().UpdateKundeKontakte(k);
}
catch (SQLiteException)
{
throw;
}
}
示例2: Form2
public Form2()
{
InitializeComponent();
hardB = new Button();
promptL = new Label();
easyB = new Button();
medium = new Button();
promptL.Text = "Please select a difficulty";
promptL.AutoSize = true;
promptL.Location = new Point(71, 9);
medium.Location = new Point(94, 90);
medium.Text = "Medium";
medium.Click += medium_Click;
easyB.Location = new Point(94, 55);
easyB.Text = "Easy";
easyB.Click += easy_Click;
hardB.Location = new Point(94, 125);
hardB.Text = "Hell";
hardB.Click += hard_Click;
this.Controls.Add(easyB);
this.Controls.Add(promptL);
this.Controls.Add(medium);
this.Controls.Add(hardB);
easyB.Hide();
medium.Hide();
hardB.Hide();
promptL.Hide();
hardB.Enabled = false;
}
示例3: PlayerInventory
public PlayerInventory()
{
InitializeComponent();
this.equippedItemPositions.Add(new Position(x: 82, y: 10)); // head
this.equippedItemPositions.Add(new Position(x: 12, y: 80)); // weapon
this.equippedItemPositions.Add(new Position(x: 82, y: 80)); // chainmail
this.equippedItemPositions.Add(new Position(x: 152, y: 80)); // gloves
this.equippedItemPositions.Add(new Position(x: 82, y: 150)); // boots
this.inventoryItemPositions.Add(new Position(x: 12, y: 220));
this.inventoryItemPositions.Add(new Position(x: 82, y: 220));
this.inventoryItemPositions.Add(new Position(x: 152, y: 220));
this.inventoryItemPositions.Add(new Position(x: 222, y: 220));
this.inventoryItemPositions.Add(new Position(x: 292, y: 220));
this.inventoryItemPositions.Add(new Position(x: 12, y: 290));
this.inventoryItemPositions.Add(new Position(x: 82, y: 290));
this.inventoryItemPositions.Add(new Position(x: 152, y: 290));
this.inventoryItemPositions.Add(new Position(x: 222, y: 290));
this.inventoryItemPositions.Add(new Position(x: 292, y: 290));
playerStats = new Label();
playerStats.Left = 250;
playerStats.Top = 20;
playerStats.Width = 100;
playerStats.Height = 150;
playerStats.BackColor = Color.Transparent;
playerStats.ForeColor = Color.White;
playerStats.Font = new Font("Microsoft Sans Serif", 9, FontStyle.Bold);
Controls.Add(playerStats);
statsBox = new Label();
statsBox.Width = 104;
statsBox.Height = 130;
statsBox.BackColor = Color.Black;
statsBox.ForeColor = Color.White;
statsBox.Font = new Font("Microsoft Sans Serif", 9, FontStyle.Bold);
statsBox.TextAlign = ContentAlignment.TopCenter;
statsBox.BackColor = Color.FromArgb(150, 0, 0, 0);
Controls.Add(statsBox);
statsBox.Hide();
}
示例4: Battle
public Battle()
{
InitializeComponent();
this.attackPb.Value = BattleManager.AttackDicePoints;
this.defendPb.Value = BattleManager.DefendDicePoints;
this.attackSkillLowPb.Value = BattleManager.AttackSkill1DicePoints;
this.attackSkillMedPb.Value = BattleManager.AttackSkill2DicePoints;
this.attackSkillHeavyPb.Value = BattleManager.AttackSkill3DicePoints;
this.attackBuffPb.Value = BattleManager.AttackBuffDicePoints;
this.defenceBuffPb.Value = BattleManager.DefenceBuffDicePoints;
this.healthBuffPb.Value = BattleManager.HealthDicePoints;
targetBox = new Label();
targetBox.Left = 500;
targetBox.Top = 0;
targetBox.Width = 130;
targetBox.Height = 68;
targetBox.Image = Properties.Resources.target_panel;
targetBox.BackColor = Color.Transparent;
targetBox.ForeColor = Color.White;
targetBox.Padding = new Padding(30, 0, 25, 0);
targetBox.Font = new Font("Microsoft Sans Serif", 8);
Controls.Add(targetBox);
targetBox.Hide();
unitDamage = new Label();
unitDamage.Width = 150;
unitDamage.Height = 70;
unitDamage.AutoSize = true;
unitDamage.BackColor = Color.Transparent;
unitDamage.Font = new Font("Microsoft Sans Serif", 35, FontStyle.Bold);
unitDamage.TextAlign = ContentAlignment.MiddleCenter;
Controls.Add(unitDamage);
unitDamage.Hide();
mainStatsBox = new Label();
mainStatsBox.Left = 650;
mainStatsBox.Top = 670;
mainStatsBox.Width = 85;
mainStatsBox.Height = 120;
mainStatsBox.BackColor = Color.Transparent;
mainStatsBox.ForeColor = Color.White;
Controls.Add(mainStatsBox);
subStatsBox = new Label();
subStatsBox.Left = 735;
subStatsBox.Top = 670;
subStatsBox.Width = 80;
subStatsBox.Height = 120;
subStatsBox.BackColor = Color.Transparent;
subStatsBox.ForeColor = Color.White;
Controls.Add(subStatsBox);
dicePointsBox = new Label();
dicePointsBox.Left = 870;
dicePointsBox.Top = 590;
dicePointsBox.Width = 150;
dicePointsBox.Height = 60;
dicePointsBox.BackColor = Color.Transparent;
dicePointsBox.ForeColor = Color.White;
dicePointsBox.Image = Properties.Resources.dices;
dicePointsBox.ImageAlign = ContentAlignment.TopLeft;
dicePointsBox.TextAlign = ContentAlignment.TopRight;
dicePointsBox.Font = new Font("Microsoft Sans Serif", 27, FontStyle.Bold);
dicePointsBox.Padding = new Padding(0, 10, 30, 0);
Controls.Add(dicePointsBox);
experienceBar = new ProgressBar();
experienceBar.Location = new Point(294, 739);
experienceBar.Name = "experienceBar";
experienceBar.Size = new Size(296, 24);
experienceBar.TabIndex = 14;
experienceBar.Maximum = GameEngine.PlayerCharacter.CalculateExperience(GameEngine.PlayerCharacter.Level);
experienceBar.Value = GameEngine.PlayerCharacter.Experience;
experienceBar.BackColor = ColorTranslator.FromHtml("#b0b0b1");
experienceBar.ForeColor = ColorTranslator.FromHtml("#04252d");
experienceBar.Style = ProgressBarStyle.Continuous;
Controls.Add(experienceBar);
characterPicture = new PictureBox();
characterPicture.Image = GetCharacterImage(GetCharacterClass(GameEngine.PlayerCharacter));
characterPicture.Width = 250;
characterPicture.Height = 250;
characterPicture.BackColor = Color.Transparent;
characterPicture.Left = 750;
characterPicture.Top = 200;
this.Controls.Add(characterPicture);
playerName.Text = "Player: " + GameEngine.PlayerCharacter.Name;
battle.CreateEnemies();
}
示例5: videoCtrl
private void videoCtrl(PictureBox PlayScreen, Label lblVideo,string screan)
{
string mciCommand;
string alias = "MyAVI";
if (lblVideo.Tag == null || lblVideo.Tag.ToString() != "正在播放")
{
lblVideo.Hide();
mciCommand = string.Format("open {0}\\video\\video.wmv alias {1} ", Environment.CurrentDirectory, alias);
mciCommand = mciCommand + " parent " + PlayScreen.Handle.ToInt32() + " style child ";
LibWrap.mciSendString(mciCommand, null, 0, 0);
Rectangle r = PlayScreen.ClientRectangle;
mciCommand = string.Format(" put {0} window at 0 0 {1} {2}", alias, r.Width, r.Height);
LibWrap.mciSendString(mciCommand, null, 0, 0);
LibWrap.mciSendString(string.Format(" play {0} repeat", alias), null, 0, 0);
lblVideo.Tag = "正在播放";
}
else
{
LibWrap.mciSendString(string.Format("close {0}", alias), null, 0, 0);
lblVideo.Show();
lblVideo.Tag = "停止播放";
}
}
示例6: ShopInventory
public ShopInventory()
{
InitializeComponent();
this.shopItemsPossitions.Add(new Position(12, 40));
this.shopItemsPossitions.Add(new Position(82, 40));
this.shopItemsPossitions.Add(new Position(152, 40));
this.shopItemsPossitions.Add(new Position(222, 40));
this.shopItemsPossitions.Add(new Position(292, 40));
this.shopItemsPossitions.Add(new Position(12, 110));
this.shopItemsPossitions.Add(new Position(82, 110));
this.shopItemsPossitions.Add(new Position(152, 110));
this.shopItemsPossitions.Add(new Position(222, 110));
this.shopItemsPossitions.Add(new Position(292, 110));
this.shopItemsPossitions.Add(new Position(12, 180));
this.shopItemsPossitions.Add(new Position(82, 180));
this.shopItemsPossitions.Add(new Position(152, 180));
this.shopItemsPossitions.Add(new Position(222, 180));
this.shopItemsPossitions.Add(new Position(292, 180));
this.shopItemsPossitions.Add(new Position(12, 250));
this.shopItemsPossitions.Add(new Position(82, 250));
this.shopItemsPossitions.Add(new Position(152, 250));
this.shopItemsPossitions.Add(new Position(222, 250));
this.shopItemsPossitions.Add(new Position(292, 250));
this.shopItemsPossitions.Add(new Position(12, 320));
this.shopItemsPossitions.Add(new Position(82, 320));
this.shopItemsPossitions.Add(new Position(152, 320));
this.shopItemsPossitions.Add(new Position(222, 320));
this.shopItemsPossitions.Add(new Position(292, 320));
this.inventoryPossitions.Add(new Position(378, 40));
this.inventoryPossitions.Add(new Position(448, 40));
this.inventoryPossitions.Add(new Position(378, 110));
this.inventoryPossitions.Add(new Position(448, 110));
this.inventoryPossitions.Add(new Position(378, 180));
this.inventoryPossitions.Add(new Position(448, 180));
this.inventoryPossitions.Add(new Position(378, 250));
this.inventoryPossitions.Add(new Position(448, 250));
this.inventoryPossitions.Add(new Position(378, 320));
this.inventoryPossitions.Add(new Position(448, 320));
//name, price, picture, def, attk, hit, str, dex, vit, int, lvl
this.shopItems.Add(new Weapon("Lightnig Dagger", 45, Pictures.RareDager, 0, 5, 0, 0, 0, 0, 10, 4, "This dagger is created for mage users."));
this.shopItems.Add(new Weapon("Big Sword", 100, Pictures.RareSword, 0, 22, 0, 0, 10, 0, 0, 8, "Big sword for heavy strikes."));
this.shopItems.Add(new Weapon("Iron Sword", 5, Pictures.BasickSword, 0, 7, 0, 1, 0, 0, 0, 2, "Basic battle equipment."));
this.shopItems.Add(new Helmet("Iron-horn Helm", 20, Pictures.WarriorHelmet, 2, 0, 3, 1, 0, 1, 0, 3, "Basic - but stylish."));
this.shopItems.Add(new Gloves("Fighter Gloves", 15, Pictures.WarriorsGloves, 1, 2, 1, 0, 1, 0, 0, 1, "Good for melee characters."));
this.shopItems.Add(new Boots("Armored Boots", 10, Pictures.WarriorBoots, 2, 2, 0, 0, 0, 1, 0, 2, "Heavy and slow."));
this.shopItems.Add(new Chainmail("Chainmail", 25, Pictures.WarriorChainmail, 2, 0, 0, 0, 1, 1, 0, 1, "Chainmail armor makes you more agile."));
this.shopItems.Add(new Potion("Small Health Potion", 20, Pictures.HealingPotion, 0, 0, 0, 0, 0, 0, 0, 1, "Return + 10hp"));
this.shopItems.Add(new Scroll("Teleport Scroll", 0, Pictures.Scroll, 0, 0, 0, 0, 0, 0, 0, 1, "Use to teleport to location."));
this.shopItems.Add(new Weapon("Stone Axe", 35, Pictures.BasickAxe, 0, 7, 0, 0, 3, 0, 0, 4, "Made from solid granit."));
this.shopItems.Add(new Weapon("Golden Staff", 75, Pictures.RareStaff, 0, 1, 0, 0, 0, 2, 4, 5, "Powered by the sun."));
this.shopItems.Add(new Helmet("Wizards Hat", 50, Pictures.MageHelmet, 2, 0, 1, 0, 0, 1, 2, 3, "No wizard go out without his hat."));
this.shopItems.Add(new Gloves("Assassin Gloves", 15, Pictures.RogueGLoves, 1, 0, 3, 0, 1, 0, 1, 3, "Deadly in the right hands."));
this.shopItems.Add(new Boots("Golden Sandals", 170, Pictures.RogueBoots, 1, 1, 1, 1, 1, 1, 1, 1, "One hell of a quality item."));
this.shopItems.Add(new Chainmail("Wool Robe", 25, Pictures.MageChainmail, 2, 0, 0, 0, 2, 1, 0, 1, "Your best friend in cold winter nights."));
this.shopItems.Add(new Weapon("Sacura Staff", 45, Pictures.MidStaff, 0, 7, 0, 0, 0, 1, 2, 4, "Eastern mistery."));
this.shopItems.Add(new Weapon("Colibri", 55, Pictures.MidDager, 0, 8, 0, 1, 0, 0, 0, 2, "Dual strike - very fast"));
statsBox = new Label();
statsBox.Width = 104;
statsBox.Height = 140;
statsBox.BackColor = Color.Black;
statsBox.ForeColor = Color.White;
statsBox.Font = new Font("Microsoft Sans Serif", 9, FontStyle.Bold);
statsBox.TextAlign = ContentAlignment.TopCenter;
statsBox.BackColor = Color.FromArgb(150, 0, 0, 0);
Controls.Add(statsBox);
statsBox.Hide();
}
示例7: led
public void led(int num, Label lbl1, Label lbl2, Label lbl3, Label lbl4, Label lbl5, Label lbl6, Label lbl7)
{
switch (num)
{
case 0:
lbl1.Show();
lbl2.Show();
lbl3.Show();
lbl4.Show();
lbl5.Show();
lbl6.Show();
lbl7.Hide();
break;
case 1:
lbl1.Hide();
lbl2.Hide();
lbl3.Hide();
lbl4.Hide();
lbl5.Show();
lbl6.Show();
lbl7.Hide();
break;
case 2:
lbl1.Show();
lbl2.Show();
lbl3.Hide();
lbl4.Show();
lbl5.Show();
lbl6.Hide();
lbl7.Show();
break;
case 3:
lbl1.Show();
lbl2.Hide();
lbl3.Hide();
lbl4.Show();
lbl5.Show();
lbl6.Show();
lbl7.Show();
break;
case 4:
lbl1.Hide();
lbl2.Hide();
lbl3.Show();
lbl4.Hide();
lbl5.Show();
lbl6.Show();
lbl7.Show();
break;
case 5:
lbl1.Show();
lbl2.Hide();
lbl3.Show();
lbl4.Show();
lbl5.Hide();
lbl6.Show();
lbl7.Show();
break;
case 6:
lbl1.Show();
lbl2.Show();
lbl3.Show();
lbl4.Show();
lbl5.Hide();
lbl6.Show();
lbl7.Show();
break;
case 7:
lbl1.Hide();
lbl2.Hide();
lbl3.Hide();
lbl4.Show();
lbl5.Show();
lbl6.Show();
lbl7.Hide();
break;
case 8:
lbl1.Show();
lbl2.Show();
lbl3.Show();
lbl4.Show();
lbl5.Show();
lbl6.Show();
lbl7.Show();
break;
case 9:
lbl1.Hide();
lbl2.Hide();
lbl3.Show();
lbl4.Show();
lbl5.Show();
lbl6.Show();
lbl7.Show();
break;
}
}
示例8: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
//フォームの初期化
this.Text = "Route_Search";
this.FormBorderStyle = FormBorderStyle.FixedSingle;
//ラベルの初期化
label1 = new Label();
label1.Text = "このプログラムは\n迷路探索プログラムです。\n探索の様子を表す木構造と\n迷路の回答を表示します。";
label1.Font = new Font("メイリオ", 15, FontStyle.Bold);
label1.Location = new Point(15, 69);
label1.AutoSize = true;
label1.TextAlign = ContentAlignment.MiddleCenter;
this.Controls.Add(label1);
label1.Click += new EventHandler(label1_Click);
label2 = new Label();
label2.Text = "テキストボックスに\nデータを入力してく\nださい。\n・0:走行可能\n・1:走行不可能\n・2:スタート\n・3:ゴール\n" +
"[例]\n2, 0, 0 左のように数字\n0, 1, 0 の間に\",\"を入れ\n0, 0, 3 てください";
label2.Font = new Font("メイリオ", 7, FontStyle.Bold);
label2.Location = new Point(170, 50);
label2.AutoSize = true;;
this.Controls.Add(label2);
label2.Click += new EventHandler(label1_Click);
label2.Hide();
label3 = new Label();
label3.Font = new Font("メイリオ", 10, FontStyle.Bold);
label3.Location = new Point(10, 430);
label3.BackColor = Color.Gainsboro;
label3.BorderStyle = BorderStyle.Fixed3D;
label3.AutoSize = true; ;
this.Controls.Add(label3);
label3.Hide();
label4 = new Label();
label4.Font = new Font("メイリオ", 10, FontStyle.Bold);
label4.Location = new Point(10, 430);
label4.BackColor = Color.Gainsboro;
label4.BorderStyle = BorderStyle.Fixed3D;
label4.AutoSize = true; ;
this.Controls.Add(label4);
label4.Hide();
//ボタンの初期化
bt1.Text = "ファイル入力";
bt1.Location = new Point(20, 100);
bt1.Size = new Size(112, 60);
bt1.Font = new Font("メイリオ", 9, FontStyle.Bold);
bt1.Click += new EventHandler(bt1_Click);
this.Controls.Add(bt1);
bt1.Hide();
bt2.Text = "キーボード入力";
bt2.Location = new Point(152, 100);
bt2.Size = new Size(112, 60);
bt2.Font = new Font("メイリオ", 9, FontStyle.Bold);
bt2.Click += new EventHandler(bt2_Click);
this.Controls.Add(bt2);
bt2.Hide();
bt3.Text = "参照";
bt3.Size = new Size(50, 25);
bt3.Location = new Point(225, 50);
bt3.Font = new Font("メイリオ", 10, FontStyle.Bold);
bt3.Click += new EventHandler(bt3_Click);
this.Controls.Add(bt3);
bt3.Hide();
bt4.Text = "表示";
bt4.Size = new Size(70, 35);
bt4.Location = new Point(210, 220);
bt4.Font = new Font("メイリオ", 10, FontStyle.Bold);
bt4.Click += new EventHandler(bt4_Click);
this.Controls.Add(bt4);
bt4.Hide();
bt5.Text = "表示";
bt5.Size = new Size(70, 35);
bt5.Location = new Point(210, 220);
bt5.Font = new Font("メイリオ", 10, FontStyle.Bold);
bt5.Click += new EventHandler(bt5_Click);
this.Controls.Add(bt5);
bt5.Hide();
bt6.Text = "データの変更";
bt6.Size = new Size(110, 35);
bt6.Location = new Point(360, 425);
bt6.Font = new Font("メイリオ", 10, FontStyle.Bold);
bt6.Click += new EventHandler(bt6_Click);
this.Controls.Add(bt6);
bt6.Hide();
bt7.Text = "深さ優先探索";
bt7.Size = new Size(110, 35);
bt7.Location = new Point(230, 10);
bt7.Font = new Font("メイリオ", 10, FontStyle.Bold);
bt7.Click += new EventHandler(bt7_Click);
this.Controls.Add(bt7);
bt7.Hide();
//.........这里部分代码省略.........
示例9: ingred
public ingred(PictureBox p, Label pos, ProgressBar prg)
{
this.p = p;
this.pos = pos;
this.prg = prg;
pos.Hide();
}
示例10: AddControls
private void AddControls()
{
ToolStrip toolStrip = new ToolStrip();
Controls.Add(toolStrip);
ToolStripLabel folderLabel = new ToolStripLabel();
folderLabel.Text = "Folder";
toolStrip.Items.Add(folderLabel);
folderComboBox = new ToolStripComboBox();
folderComboBox.AutoSize = false;
SetComboBoxItems(folderComboBox, settings.folderPaths);
folderComboBox.SelectedIndexChanged += FolderComboBox_SelectedIndexChanged;
toolStrip.Items.Add(folderComboBox);
ToolStripLabel songLabel = new ToolStripLabel();
songLabel.Text = "Song";
toolStrip.Items.Add(songLabel);
songComboBox = new ToolStripComboBox();
songComboBox.AutoSize = false;
songComboBox.Width = 25;
toolStrip.Items.Add(songComboBox);
UpdateSongComboBox();
ToolStripButton showSongButton = new ToolStripButton();
showSongButton.Text = "Show song";
showSongButton.Click += ShowSongButton_Click;
toolStrip.Items.Add(showSongButton);
toolStrip.Items.Add(new ToolStripSeparator());
ToolStripButton showHelpButton = new ToolStripButton();
showHelpButton.Text = "Show help";
showHelpButton.Click += ShowHelpButton_Click;
toolStrip.Items.Add(showHelpButton);
ToolStripButton launchPlayerButton = new ToolStripButton();
launchPlayerButton.Text = "Launch player";
launchPlayerButton.Click += LaunchPlayerButton_Click;
toolStrip.Items.Add(launchPlayerButton);
toolStrip.Items.Add(new ToolStripSeparator());
ToolStripButton addFolderButton = new ToolStripButton();
addFolderButton.Text = "Add folder";
addFolderButton.Click += AddFolderButton_Click;
toolStrip.Items.Add(addFolderButton);
ToolStripButton changePlayerButton = new ToolStripButton();
changePlayerButton.Text = "Change player";
changePlayerButton.Click += ChangePlayerButton_Click;
toolStrip.Items.Add(changePlayerButton);
ToolStripButton changeInputButton = new ToolStripButton();
changeInputButton.Text = "Change input";
changeInputButton.Click += ChangeInputButton_Click;
toolStrip.Items.Add(changeInputButton);
pictureBox = new PictureBox();
pictureBox.BackColor = Color.White;
pictureBox.Size = new Size(Size.Width, Size.Height - toolStrip.Height);
pictureBox.Location = new Point(0, toolStrip.Height);
Controls.Add(pictureBox);
folderSwitchingLabel = new Label();
folderSwitchingLabel.Text = ("Press left or right to change a folder and select to confirm");
folderSwitchingLabel.TextAlign = ContentAlignment.MiddleCenter;
folderSwitchingLabel.Size = Size;
folderSwitchingLabel.Hide();
Controls.Add(folderSwitchingLabel);
exitPressedLabel = new Label();
exitPressedLabel.Text = ("Press stop to exit or play to continue");
exitPressedLabel.TextAlign = ContentAlignment.MiddleCenter;
exitPressedLabel.Size = Size;
exitPressedLabel.Hide();
Controls.Add(exitPressedLabel);
LoadPages();
}
示例11: Display_Load
//.........这里部分代码省略.........
"%\n\nSize of Design: " + (XMAX - XMIN).ToString("0.0") + " X " + (YMAX - YMIN).ToString("0.0");
SizeDesign = (XMAX - XMIN).ToString("0.0") + " x " + (YMAX - YMIN).ToString("0.0");
Inch_Calculator.AutoSize = true;
Inch_Calculator.ForeColor = Color.White;
Inch_Calculator.Font = new Font("Times New Roman", 9.0F);
this.Controls.Add(Inch_Calculator);
int InchColorY = 620;
InchColor = new Label[11];
for (int i = 0; i < 11; i++)
InchColor[i] = new Label();
InchColor[0].Text = "G0 Move";
InchColor[0].ForeColor = Color.BlueViolet;
InchColor[0].Location = new Point((int)(SCREENWIDTH * .75), InchColorY);
InchColor[1].Text = "Etching";
InchColor[1].ForeColor = Color.Blue;
InchColor[1].Location = new Point((InchColor[0].Location.X + 60), InchColorY);
InchColor[2].Text = "2 Point";
InchColor[2].ForeColor = Color.Green;
InchColor[2].Location = new Point((InchColor[1].Location.X + 50), InchColorY);
InchColor[3].Text = "3 Point";
InchColor[3].ForeColor = Color.Cyan;
InchColor[3].Location = new Point((InchColor[0].Location.X), InchColorY + 20);
InchColor[4].Text = "1 Pass";
InchColor[4].ForeColor = Color.WhiteSmoke;
InchColor[4].Location = new Point((InchColor[3].Location.X + 50), InchColorY + 20);
InchColor[5].Text = "1.5 Point";
InchColor[5].ForeColor = Color.LightCyan;
InchColor[5].Location = new Point((InchColor[4].Location.X + 50), InchColorY + 20);
InchColor[6].Text = "Buffer";
InchColor[6].ForeColor = Color.LightBlue;
InchColor[6].Location = new Point((InchColor[0].Location.X), InchColorY + 40);
InchColor[7].Text = "Snug";
InchColor[7].ForeColor = Color.Gray;
InchColor[7].Location = new Point((InchColor[6].Location.X + 50), InchColorY + 40);
InchColor[8].Text = "Wide";
InchColor[8].ForeColor = Color.LightGreen;
InchColor[8].Location = new Point((InchColor[7].Location.X + 50), InchColorY + 40);
InchColor[9].Text = "Pulsing";
InchColor[9].ForeColor = Color.Salmon;
InchColor[9].Location = new Point((InchColor[0].Location.X), InchColorY + 60);
if (ShowFBB == true)
{
InchColor[10].Text = "FBB";
InchColor[10].ForeColor = Color.Red;
InchColor[10].Location = new Point((InchColor[9].Location.X + 50), InchColorY + 60);
}
foreach (Label l in InchColor)
{
l.AutoSize = true;
l.Font = new Font("Times New Roman", 9.0F);
this.Controls.Add(l);
}
drawingBarLabel = new Label();
drawingBarLabel.Text = "Slow Down/Speed Up Drawing";
drawingBarLabel.Location = new Point((int)(SCREENWIDTH * .75), 360);
drawingBarLabel.AutoSize = true;
drawingBarLabel.ForeColor = Color.White;
drawingBarLabel.Font = new Font("Times New Roman", 9.0F);
drawingBarLabel.Hide();
this.Controls.Add(drawingBarLabel);
drawingBar.Location = new Point((int)(SCREENWIDTH * .75), 375);
drawingBar.Width = 300;
drawingBar.TickStyle = TickStyle.None;
drawingBar.Hide();
/*
* ******************************************/
#endregion
this.BackColor = Color.Black;
this.ForeColor = Color.Black;
this.Location = new Point(0, 0);
//Saves the canvas to a temporary file
CanvasCopy = new TemporaryFile();
mainCanvas.Save(@CanvasCopy.FilePath);
ArgsCommands(args);
full_maximize(sender, e);
this.Refresh(); //Refreshes the form
g.Dispose(); //Releases the resources used by Graphics g
this.TopMost = true;
this.Activate();
}
示例12: Form1
//.........这里部分代码省略.........
par_getter.Top = Q2.Bottom + 5;
par_getter.Width = Q2.Width;
par_getter.MouseLeave += SetFunc;
FShow = new Label();
FShow.Tag = "Функция: ";
FShow.Text = "Функция: ";
Controls.Add(FShow);
FShow.Size = Q1.Size;
FShow.BorderStyle = BorderStyle.FixedSingle;
FShow.Padding = new Padding(5, 5, 5, 5);
FShow.Left = 10;
FShow.Top = par_getter.Bottom + 5;
QEps = new Label();
Controls.Add(QEps);
QEps.Text = "Введите границы промежутка и точность";
QEps.Size = Q1.Size;
QEps.Left = 10;
QEps.BorderStyle = BorderStyle.FixedSingle;
QEps.Padding = new Padding(5, 5, 5, 5);
QEps.Top = FShow.Bottom + 5;
basepars = new TextBox[3];
basepars[0] = new TextBox();
Controls.Add(basepars[0]);
basepars[1] = new TextBox();
Controls.Add(basepars[1]);
basepars[2] = new TextBox();
Controls.Add(basepars[2]);
foreach (TextBox tb in basepars)
{
tb.Width = QEps.Width / 3 - 8;
tb.Top = QEps.Bottom + 5;
tb.MouseClick += TextClear;
}
basepars[0].Left = 10;
basepars[1].Left = basepars[0].Right + 12;
basepars[2].Left = QEps.Right - basepars[2].Width;
basepars[0].Text = "a";
basepars[1].Text = "b";
basepars[2].Text = "c";
Execute = new Button();
Controls.Add(Execute);
Execute.Left = 5;
Execute.Text = "Execute";
Execute.Top = basepars[0].Bottom + 15;
Execute.AutoSize = true;
Execute.MouseClick += ProcessMethod;
Execute.Padding = new Padding(5, 5, 5, 5);
Ans = new Label();
Controls.Add(Ans);
//Ans.Visible = false;
Ans.Top = Execute.Top;
Ans.BorderStyle = BorderStyle.FixedSingle;
Ans.Tag = "Answer: ";
Ans.Text = "Answer";
Ans.Left = Execute.Right + 10;
Ans.Width = QEps.Right - Ans.Left;
Ans.Height = Execute.Height;
Ans.TextAlign = ContentAlignment.MiddleCenter;
img = new PictureBox();
Controls.Add(img);
img.BorderStyle = BorderStyle.FixedSingle;
img.Left = Q1.Right + 20;
img.Width = 300;
img.Top = Q1.Top;
img.Height = 270;
Draw = new Button();
Controls.Add(Draw);
Draw.BringToFront();
Draw.Text = "Draw";
Draw.Padding = new Padding(5, 5, 5, 5);
Draw.AutoSize = true;
Draw.Left = img.Left;
Draw.Top = img.Bottom+5;
Draw.Enabled = false;
Draw.MouseClick += SetGraphics;
Draw.MouseClick += IncludeDescr;
ImgDescr = new Label();
Controls.Add(ImgDescr);
ImgDescr.Text = "Красные точки - середины текущих отрезков.\nСиние точки - 1/4 и 3/4 текущего отрезка.";
ImgDescr.BorderStyle = BorderStyle.FixedSingle;
ImgDescr.Padding = new Padding(0, 0, 0, 0);
ImgDescr.Font = new Font("Arial", (float)6.75);
ImgDescr.TextAlign = ContentAlignment.TopCenter;
ImgDescr.Left = Draw.Right + 5;
ImgDescr.Top = Draw.Top;
ImgDescr.Width = 295 - Draw.Width;
ImgDescr.Height = Draw.Height;
ImgDescr.Hide();
this.Size = new Size(590, 360);
this.Text = "Минимизация одномерной функции: метод деления пополам";
}