I don't have VB docs, but there are a number examples on the net with your exact syntax. Perhaps there's a constraint if it isn't instantiated with the right constructor....
Quote:
|
Originally Posted by 4GuysFromRolla
Dim lblMessage as New Label()
...
Pretty simple, eh? Next, we need to set the various Label properties we're interested in. For this example, let's set the Text and the Font.Bold property:
lblMessage.Text = "Hello, World!"
lblMessage.Font.Bold = True
|