本文整理汇总了C#中System.Windows.Forms.Label.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Label.Show方法的具体用法?C# Label.Show怎么用?C# Label.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Label
的用法示例。
在下文中一共展示了Label.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createNewLabel
private void createNewLabel(int x, int y, int width, int height, string text)
{
Label newLabel = new Label();
newLabel.Parent = this;
newLabel.Text = text;
newLabel.SetBounds(x, y, width, height);
newLabel.Show();
}
示例2: StatForm_Load
private void StatForm_Load(object sender, EventArgs e) {
bwComputer.RunWorkerAsync();
vStatDataGridView.Sort(c容量の割合, ListSortDirection.Descending);
la = new Label();
la.Parent = this;
la.Dock = DockStyle.Fill;
la.Text = "走査・集計しています。御待ちください。";
la.TextAlign = ContentAlignment.MiddleCenter;
la.Show();
}
示例3: NewMapDlg
public NewMapDlg()
: base()
{
FormBorderStyle = FormBorderStyle.FixedDialog;
Label t = new Label();
t.Text = "Width";
t.Location = new Point(10, 10);
t.Show();
Label u = new Label();
u.Text = "Height";
u.Location = new Point(t.Left, t.Bottom + 5);
u.Show();
widthbox = new TextBox();
widthbox.Location = new Point(t.Right + 5, 10);
widthbox.Show();
heightbox = new TextBox();
heightbox.Location = new Point(widthbox.Left, widthbox.Bottom + 5);
heightbox.Show();
Button okbutton = new Button();
okbutton.Text = "OK";
okbutton.DialogResult = DialogResult.OK;
okbutton.Location = new Point(t.Left, u.Bottom + 5);
okbutton.Show();
Button cancelbutton = new Button();
cancelbutton.Text = "Cancel";
cancelbutton.DialogResult = DialogResult.Cancel;
cancelbutton.Location = new Point(okbutton.Right + 5, okbutton.Top);
cancelbutton.Show();
Controls.Add(t);
Controls.Add(u);
Controls.Add(widthbox);
Controls.Add(heightbox);
Controls.Add(okbutton);
Controls.Add(cancelbutton);
AcceptButton = okbutton;
CancelButton = cancelbutton;
Width = heightbox.Right + 35;
Height = okbutton.Bottom + 35;
}
示例4: Main
/// <summary>
/// The main entry point for the application.
/// </summary>
private static void Main(string[] args)
{
try
{
using (Control game = new Control())
{
game.Run();
}
}
#region Catch Section
catch (Exception e)
{
if (File.Exists("Output.txt"))
{
// Use a try block to catch IOExceptions, to
// handle the case of the file already being
// opened by another process.
try
{
File.Delete("Output.txt");
}
catch (IOException io)
{
Console.WriteLine(io.Message);
return;
}
}
using (var file = new StreamWriter("ErrorLog.txt", true))
{
file.WriteLine(DateTime.Now.ToLongDateString() + ", " + DateTime.Now.ToLongTimeString());
file.WriteLine(e);
Form test = new Form();
test.Text = "ERROR";
test.Size = new Size(300, 150);
Label message = new Label();
message.Text =
"Sorry, an error has occurred. please send the output and error logs to [email protected], and i will fix it as soon as i can :)";
message.Parent = test;
message.Show();
message.Dock = DockStyle.Fill;
test.ShowDialog();
}
Console.WriteLine(e);
}
#endregion
}
示例5: AboutGUI
public AboutGUI()
{
this.Width = 415;
this.Height = 345;
this.Text = "About";
this.FormBorderStyle = FormBorderStyle.FixedSingle;
this.StartPosition = FormStartPosition.CenterParent;
this.ControlBox = false;
Panel frame = new Panel();
frame.BorderStyle = BorderStyle.FixedSingle;
frame.Left = 15;
frame.Width = 380;
frame.Top = 15;
frame.Height = 258;
frame.Show();
this.Controls.Add( frame );
Label about = new Label();
//about.BackColor = System.Drawing.Color.Green;
about.Left = 2;
about.Width = frame.Width - 4;
about.Top = 2;
about.Height = frame.Height - 4;
about.Show();
frame.Controls.Add( about );
string a = "";
a += "This backgammon program is freeware and has been part of a Master thesis on intelligent game agents. The original program and its associated paper were composed by Mikael Heinze at Aalborg University Esbjerg in Denmark in the period 2nd February to 21st December 2004.\n\n";
a += "The programs purpose was to work as a problem/test domain for an adaptive and intelligent computer player named Fuzzeval based on fuzzy logic and fuzzy control. For evaluation purpose other computer players based on other principles has also been implemented. To configure an opponent (agent) one can select what decision module that is to be used for move and cube evaluation.\n\n";
a += "This is however a greatly improved version of this original backgammon program completed at the 26th of April 2005. This version includes a large range of new features, improvements and bug fixes. Examples are a stronger computer opponent named TD-NN 2 and implementation of the cube. It is however only the two TD-NN evaluators that in reality supports cube handling.\n\n";
a += "Happy playing.";
about.Text = a;
Button ok = new Button();
ok.Text = "OK";
ok.Left = 320;
ok.Top = 280;
ok.Click += new EventHandler(ok_Click);
ok.Show();
this.Controls.Add( ok );
}
示例6: PulseGeneratorForm
public PulseGeneratorForm(PIC.PIC pic)
{
InitializeComponent();
portAAdapter = (PIC.Ports.IOAdapter) pic.getRegisterFileMap().getAdapter(PIC.Register.RegisterConstants.PORTA_ADDRESS);
portBAdapter = (PIC.Ports.IOAdapter) pic.getRegisterFileMap().getAdapter(PIC.Register.RegisterConstants.PORTB_ADDRESS);
intervalABox.Text = DEFAULT_INTERVAL.ToString();
intervalBBox.Text = DEFAULT_INTERVAL.ToString();
portATimer.Elapsed += portATimer_Elapsed;
portBTimer.Elapsed += portBTimer_Elapsed;
int i = 0;
Label label;
// PORT-Checkboxes dynamisch erstellen
for (i = 0; i < 8; i++)
{
portACheckBoxes[7-i] = new CheckBox();
portACheckBoxes[7-i].SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), CHECKBOX_PORTA_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
portACheckBoxes[7-i].Parent = this;
portACheckBoxes[7-i].MouseClick += new MouseEventHandler(portACheckboxChanged);
label = new Label();
label.Text = (7 - i).ToString();
label.SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), LABEL_PORTA_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
label.Parent = this;
label.Show();
label.BringToFront();
portBCheckBoxes[7-i] = new CheckBox();
portBCheckBoxes[7-i].SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), CHECKBOX_PORTB_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
portBCheckBoxes[7-i].Parent = this;
portBCheckBoxes[7-i].MouseClick += new MouseEventHandler(portBCheckboxChanged);
label = new Label();
label.Text = (7 - i).ToString();
label.SetBounds(CHECKBOX_X_OFFSET + i * (CHECKBOX_WIDTH + CHECKBOX_SPACING), LABEL_PORTB_Y_OFFSET, CHECKBOX_WIDTH, CHECKBOX_WIDTH);
label.Parent = this;
label.Show();
label.BringToFront();
}
}
示例7: seriousNamesComeOnRobert
private void seriousNamesComeOnRobert(string fileExt)
{
string path = @"C:\ProjectSnowshoes\User\" + Properties.Settings.Default.username[Properties.Settings.Default.whoIsThisCrazyDoge] + @"\Pictures";
for (int i = 0; i < Directory.GetFiles(path, fileExt, SearchOption.AllDirectories).Length; i++)
{
FileInfo fiInf = new FileInfo(Directory.GetFiles(path, fileExt, SearchOption.AllDirectories)[i]);
char[] separator = new char[] { '.' };
string str2 = fiInf.Name.Split(separator)[0];
Panel panel = new Panel();
panel.Show();
panel.BackColor = Color.Transparent;
panel.Left = 0;
panel.Width = 180;
panel.Height = 110;
panel.Margin = new Padding(10);
this.imagePanel.Controls.Add(panel);
PictureBox box = new PictureBox();
box.Show();
box.Width = 160;
box.Height = 90;
box.Left = 10;
box.BackgroundImage = Image.FromFile(fiInf.FullName);
box.BackgroundImageLayout = ImageLayout.Zoom;
panel.Controls.Add(box);
Label label = new Label();
label.Show();
label.Width = 170;
label.AutoEllipsis = true;
label.Height = 14;
label.TextAlign = ContentAlignment.MiddleCenter;
label.Font = new Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 11f);
label.BackColor = Color.Transparent;
label.ForeColor = Color.DarkGray;
label.Left = 5;
label.Text = str2;
label.Top = 0x5d;
panel.Controls.Add(label);
panel.Click += (senderA, args) => Process.Start(fiInf.FullName);
box.Click += (senderA, args) => Process.Start(fiInf.FullName);
label.Click += (senderA, args) => Process.Start(fiInf.FullName);
}
}
示例8: button1_Click
private void button1_Click(object sender, EventArgs e)
{
try
{
if (waarnemingform.DialogResult == DialogResult.OK)
{
waarneming = new Waarneming(waarnemingform.SoortWaarneming, waarnemingform.Vogelsoort, Bezoek);
Bezoek.Waarnemingen.Add(waarneming);
}
Refresh();
Label lblwaarneming = new Label();
lblwaarneming.Location = Locatie;
lblwaarneming.Text = waarneming.VogelSoort.Afkorting;
lblwaarneming.Tag = waarneming;
lblwaarneming.AutoSize = true;
lblwaarneming.Show();
lblwaarneming.Click += new EventHandler(label_Clicked);
panel1.Controls.Add(lblwaarneming);
}
catch (Exception)
{
MessageBox.Show("Er zijn nog geen vogels gespot.");
}
}
示例9: AddWord
public DialogResult AddWord()
{
Form wordForm = new Form();
wordForm.StartPosition = FormStartPosition.CenterScreen;
wordForm.FormBorderStyle = FormBorderStyle.Fixed3D;
wordForm.Size = new Size(250, 180);
wordForm.MinimizeBox = false;
wordForm.MaximizeBox = false;
wordForm.Text = "Новое слово";
Label wordLabel = new Label();
wordLabel.Location = new Point(10, 10);
wordLabel.AutoSize = false;
wordLabel.Size = new Size(230, 25);
wordLabel.Font = new Font("Times New Roman", 12, FontStyle.Bold);
wordLabel.Text = "Слово: ";
Label translateLabel = new Label();
translateLabel.Location = new Point(10, 60);
translateLabel.AutoSize = false;
translateLabel.Size = new Size(230, 25);
translateLabel.Font = new Font("Times New Roman", 12, FontStyle.Bold);
translateLabel.Text = "Перевод: ";
wordTextBox = new TextBox();
wordTextBox.Location = new Point(10, 35);
wordTextBox.Size = new Size(215, 25);
wordTextBox.Text = null;
translateTextBox = new TextBox();
translateTextBox.Location = new Point(10, 85);
translateTextBox.Size = new Size(215, 25);
translateTextBox.Text = null;
Button okButton = new Button();
okButton.Location = new Point(80, 115);
okButton.Size = new Size(70, 25);
okButton.DialogResult = DialogResult.OK;
okButton.Text = "OK";
Button cancelButton = new Button();
cancelButton.Location = new Point(155, 115);
cancelButton.Size = new Size(70, 25);
cancelButton.DialogResult = DialogResult.Cancel;
cancelButton.Text = "Cancel";
wordForm.Controls.Add(wordLabel);
wordForm.Controls.Add(translateLabel);
wordForm.Controls.Add(wordTextBox);
wordForm.Controls.Add(translateTextBox);
wordForm.Controls.Add(okButton);
wordForm.Controls.Add(cancelButton);
wordLabel.Show();
translateLabel.Show();
wordTextBox.Show();
translateTextBox.Show();
okButton.Show();
cancelButton.Show();
wordForm.ShowDialog();
return wordForm.DialogResult;
}
示例10: Menu_Click
void Menu_Click(object sender, EventArgs e)
{
Program.TimerReset();
var MenuButton = sender as Button;
menu = new Menu();
menu.Tag = MenuButton.Tag;
menu.Parent = this;
menu.Location = new Point(MenuButton.Location.X - 100, MenuButton.Location.Y + MenuButton.Height);
mask = new Label();
mask.BackColor = this.BackColor;
mask.Size = this.Size;
//mask.Location = this.Location;
mask.Parent = this;
mask.BringToFront();
var nam = this.Controls[this.Controls.IndexOfKey("name" + menu.Tag.ToString())] as Button;
var org = this.Controls[this.Controls.IndexOfKey("org" + menu.Tag.ToString())] as Label;
nam.BringToFront();
org.BringToFront();
mask.Show();
menu.VisitClass += Visit_Click;
var c = list[(int)menu.Tag];
nam.Enabled = false;
menu.EditRecord += EditRecord_Click;
menu.PrintLabel += PrintLabel_Click;
menu.AddFamily += AddToFamily_Click;
menu.JoinClass += Join_Click;
if (c.cinfo.oid != 0)
{
menu.DropJoin.Visible = true;
if (c.cinfo.mv == "M")
{
menu.DropJoinClass += DropThis_Click;
menu.DropJoin.Text = "Drop This Class";
}
else
{
menu.DropJoinClass += JoinThis_Click;
menu.DropJoin.Text = "Join This Class";
}
}
else
menu.DropJoin.Visible = false;
menu.CancelMenu += new EventHandler(CancelMenu_Click);
menu.Show();
menu.BringToFront();
}
示例11: ProduceMarkerLabel
private Label ProduceMarkerLabel(Control control)
{
Label _label = new Label();
_label.Size = new Size(5, 5); _label.BackColor = Color.OrangeRed;
_label.Location = control.Location; _label.Name = "lblNew_" + control.Name;
_label.Visible = true; _label.Show(); _label.BringToFront();
if (control.Parent != null)
{
control.Parent.Controls.Add(_label);
_label.Show(); _label.BringToFront();
}
return _label;
}
示例12: 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;
}
}
示例13: 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 = "停止播放";
}
}
示例14: ShowTargetBox
public void ShowTargetBox(Label box, IUnit enemy)
{
box.Show();
box.Text = "\nAttack: " + enemy.Attack()
+ "\nDefense: " + enemy.Defend()
+ "\nHitpoints: " + enemy.CurrentHitPoints;
}
示例15: ShowSuccessLabel
// Show success messages in an existing label
public static void ShowSuccessLabel(Label l)
{
if (l == null)
{ return; }
l.Text = "Erfolgreich aktualisiert.";
l.ForeColor = Color.Green;
l.Show();
}