Silkrooster News A place to share tidbits, neat features, and hopefully a tutorial or two

February 4, 2013

Creating Labels on Windows forms

Filed under: Beginner's lesson's,Programming — Silkrooster @ 4:27 am

Ok, now lets start creating windows forms.

First let visual studio create the form for you and we will work a bit on adding controls via code.

First is Visual Basic and adding a label via code.


Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim somewords As Label

somewords = New Label()

somewords.Size = New Point(300, 30)

somewords.Location = New Point(20, 20)

somewords.TabIndex = 0

somewords.BorderStyle = BorderStyle.Fixed3D

somewords.Name = "somewords"

somewords.Text = "Hello World. Here I am..."

Me.Controls.Add(somewords)

End Sub

End Class

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress