Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2008 [RESOLVED] How do i set the TextAlignment property on a dynamically created label

$
0
0
I have spent the last two hours searching the forums and on google
trying to resolve this simple issue.
All i am trying to do is set the alignment property of a label
which has been dynamically created.

Here is my code:


Dim MenuLabel As Control = New System.Windows.Forms.Label
Me.PB1.Controls.Add(MenuLabel)

with MenuLabel

.Name = "Some Name"
.Text = "Some Text"
.ForeColor = color.Blue

End With

Adding This does Not Work

.TextAlign = System.Drawing.ContentAlignment.MiddleRight

I get the error 'TextAlign' is not a member of 'System.Windows.Forms.Control'

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>