本文整理汇总了C#中Label.BringToFront方法的典型用法代码示例。如果您正苦于以下问题:C# Label.BringToFront方法的具体用法?C# Label.BringToFront怎么用?C# Label.BringToFront使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label.BringToFront方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: For
public static Label For(Forms.Control control, Alignment alignment, int padding)
{
var label = new Label(control)
{
AutoSize = true,
Visible = true
};
label.BringToFront();
SetAlignment(label, control, alignment, padding);
return label;
}
示例2: InitializeGame
public void InitializeGame()
{
this.Text = "Shooter Game";
//Positions the players on the game panel aligned on a center horizontal line and equidistant with each other
foreach (String s in names)
{
int index = names.IndexOf(s) + 1; //must not be zero !
int x = (GamePanel.Width / (names.Count + 1)) * index;
int y = 5;
Point p = new Point(x, y);
Label scoreLabel = new Label();
scoreLabel.AutoSize = true;
scoreLabel.Name = s + "'s score";
scoreLabel.Text = s + " : " + 0;
scoreLabel.Size = new Size(100, 20);
scoreLabel.ForeColor = Color.Blue;
scoreLabel.BackColor = Color.Transparent;
scoreLabel.Location = p;
scoreLabels.Add(scoreLabel);
this.GamePanel.Controls.Add(scoreLabel);
scoreLabel.BringToFront();
}
int xPlayer = GamePanel.Width / 2;
int yPlayer = GamePanel.Height / 2;
Point pPlayer = new Point(xPlayer, yPlayer);
player.Location = pPlayer;
AddGameObject(player);
isGameStarted = true;
Thread dropEnemy = new Thread(RdnDropEnemy);
dropEnemy.Name = "RdnDrop";
dropEnemy.IsBackground = true;
dropEnemy.Start();
Thread gameThread = new Thread(Game_Thread);
gameThread.Name = "Game_Thread";
gameThread.IsBackground = true;
gameThread.Start();
}
示例3: OnReceive
private void OnReceive(IAsyncResult ar)
{
try
{
clientSocket.EndReceive(ar);
if (byteData[0] == 8)
{
EviData data = new EviData(byteData);
Evidence evi = new Evidence();
evi.name = data.strName;
evi.desc = data.strDesc;
evi.note = data.strNote;
evi.index = data.index;
using (MemoryStream ms = new MemoryStream(data.dataBytes))
{
evi.icon = Image.FromStream(ms, false, true);
}
bool found = false;
foreach (Evidence item in eviList)
{
if (item.index == evi.index)
{
found = true;
item.name = evi.name;
item.note = evi.note;
item.desc = evi.desc;
item.icon = evi.icon;
break;
}
}
if (found == false)
eviList.Add(evi);
testimonyPB.Location = new Point(257, 3);
testimonyPB.BringToFront();
PictureBox icon = new PictureBox();
icon.Image = evi.icon;
icon.Location = new Point(6, 5);
icon.Size = new Size(70, 70);
icon.BringToFront();
testimonyPB.Invoke((MethodInvoker)delegate
{
//perform on the UI thread
testimonyPB.Controls.Add(icon);
});
Label name = new Label();
name.Text = evi.name;
name.Location = new Point(91, 8);
name.Size = new Size(155, 17);
name.TextAlign = ContentAlignment.MiddleCenter;
name.ForeColor = Color.DarkOrange;
name.BackColor = Color.Transparent;
//name.Font = new Font(fonts.Families[0], 12.0f, FontStyle.Bold);
name.BringToFront();
testimonyPB.Invoke((MethodInvoker)delegate
{
//perform on the UI thread
testimonyPB.Controls.Add(name);
});
Label note = new Label();
note.Text = evi.note;
note.Location = new Point(92, 26);
note.Size = new Size(153, 44);
//note.Font = new Font(fonts.Families[0], 12.0f);
note.BackColor = Color.Transparent;
note.BringToFront();
testimonyPB.Invoke((MethodInvoker)delegate
{
//perform on the UI thread
testimonyPB.Controls.Add(note);
});
Label desc = new Label();
desc.Text = evi.desc;
desc.Location = new Point(9, 81);
desc.Size = new Size(238, 45);
//desc.Font = new Font(fonts.Families[0], 12.0f);
desc.BackColor = Color.Transparent;
desc.ForeColor = Color.White;
desc.BringToFront();
testimonyPB.Invoke((MethodInvoker)delegate
{
//perform on the UI thread
testimonyPB.Controls.Add(desc);
});
testimonyPB.Size = new Size(256, 127);
testimonyPB.Image = Image.FromFile("base/misc/inventory_update.png");
wr = new WaveFileReader("base/sounds/general/sfx-selectjingle.wav");
sfxPlayer.Initialize(wr);
if (!mute)
sfxPlayer.Play();
for (int x = 0; x <= 64; x++)
{
testimonyPB.Location = new Point(256 - (4 * x), 3);
//icon.Location = new Point(256 + 6 - (2 * x), 3 + 5);
//.........这里部分代码省略.........
示例4: ShowLabel
private void ShowLabel(string msg)
{
Label L = new Label();
L.BackColor = Color.Transparent;
L.Location = new Point(0, 0);
L.Size = this.Size;
L.Text = msg;
L.Font = new Font(System.Drawing.FontFamily.GenericSansSerif, 20);
L.TextAlign = ContentAlignment.TopCenter;
L.ForeColor = Color.DarkBlue;
L.Click += new EventHandler(L_Click);
this.Controls.Add(L);
L.BringToFront();
}