New Label invisible?

  • Thread starter Thread starter Able
  • Start date Start date
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
 
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)
 
* "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'.
 
Back
Top