I\'m trying to create a form with white label inside, that when I click on something the form will disappear and only show the label. So far I tried to put the TransparencyK
If anyone is still looking, here is what I did (mostly copied from this site)
Create a new class, CustomLabel.cs for instance. Here's an example:
public class CustomLabel : Label
{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
ControlPaint.DrawBorder(e.Graphics, ClientRectangle,
Color.Red, 5, ButtonBorderStyle.Solid,
Color.Red, 5, ButtonBorderStyle.Solid,
Color.Red, 5, ButtonBorderStyle.Solid,
Color.Red, 5, ButtonBorderStyle.Solid);
}
}
You can then use it like this:
Form newForm = new Form();
CustomLabel newLabel = new CustomLabel();
newForm.Controls.Add(newLabel);
newLabel.BackColor = Color.Black;
newLabel.Font = new System.Drawing.Font("Microsoft Arial", 18F,
FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
newLabel.ForeColor = Color.Crimson;
newLabel.Text = "Some text on a topmost transparent form window";
newForm.Show();
newForm.TopMost = true;
newLabel.AutoSize = true;
newLabel.Location = new Point(230, 375);