New Label invisible?

A

Able

Dear friends

Why is this label invisible:
Dim myLbl As New Label
myLbl.BorderStyle = BorderStyle.FixedSingle
myLbl.BackColor = Color.White
myLbl.ForeColor = Color.Black
myLbl.Size = New Size(100, 23)
myLbl.Location = New Point(5, 5)
myLbl.Visible = True
myLbl.Text = "Testing"

Regards Able
 
P

Patrick Steele [MVP]

Dear friends

Why is this label invisible:
Dim myLbl As New Label
myLbl.BorderStyle = BorderStyle.FixedSingle
myLbl.BackColor = Color.White
myLbl.ForeColor = Color.Black
myLbl.Size = New Size(100, 23)
myLbl.Location = New Point(5, 5)
myLbl.Visible = True
myLbl.Text = "Testing"

Did you add it to the Form?

Controls.Add(myLbl)
 
H

Herfried K. Wagner [MVP]

* "Able said:
Why is this label invisible:
Dim myLbl As New Label
myLbl.BorderStyle = BorderStyle.FixedSingle
myLbl.BackColor = Color.White
myLbl.ForeColor = Color.Black
myLbl.Size = New Size(100, 23)
myLbl.Location = New Point(5, 5)
myLbl.Visible = True
myLbl.Text = "Testing"

\\\
Me.Controls.Add(myLbl)
///

When creating more than one controls and adding them to the form, you
may want to use 'Me.Controls.AddRange' and/or combined with
'Me.SuspendLayout' and 'Me.ResumeLayout'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top