Click here to Skip to main content
15,899,634 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: creating many instance of a label Pin
charchabil0323-Jan-07 4:54
charchabil0323-Jan-07 4:54 
GeneralRe: creating many instance of a label Pin
mr_lasseter23-Jan-07 5:11
mr_lasseter23-Jan-07 5:11 
GeneralRe: creating many instance of a label Pin
charchabil0323-Jan-07 5:42
charchabil0323-Jan-07 5:42 
GeneralRe: creating many instance of a label Pin
mr_lasseter23-Jan-07 5:51
mr_lasseter23-Jan-07 5:51 
GeneralRe: creating many instance of a label Pin
charchabil0323-Jan-07 6:06
charchabil0323-Jan-07 6:06 
AnswerRe: creating many instance of a label Pin
mr_lasseter23-Jan-07 6:32
mr_lasseter23-Jan-07 6:32 
GeneralRe: creating many instance of a label Pin
charchabil0323-Jan-07 9:50
charchabil0323-Jan-07 9:50 
GeneralRe: creating many instance of a label Pin
mr_lasseter23-Jan-07 10:12
mr_lasseter23-Jan-07 10:12 
Public Sub AddLabel()
Dim lbl As New Label

lbl.Location = New System.Drawing.Point(100, 100)
lbl.Text = "This is a test"
lbl.Visible = True

'isCity & isState are made up values
if isCity then
lbl.Tag = 1
elseif isState then
lbl.Tag = 2
end if

Me.Controls.Add(lbl)
AddHandler lbl.Click, AddressOf Label_Click
End Sub

Private Sub Label_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim lbl as Label = DirectCast(sender, Label)
if lbl.Tag = 1 then
messagebox.show("You clicked a city")
elseif lbl.Tag = 2 then
messagebox.show("You clicked a state")
end if


End Sub

Mike Lasseter

QuestionList box loop? Pin
China-Gary23-Jan-07 2:36
China-Gary23-Jan-07 2:36 
AnswerRe: List box loop? Pin
MatrixCoder23-Jan-07 3:28
MatrixCoder23-Jan-07 3:28 
AnswerRe: List box loop? Pin
nlarson1123-Jan-07 3:31
nlarson1123-Jan-07 3:31 
GeneralRe: List box loop? Pin
China-Gary23-Jan-07 4:37
China-Gary23-Jan-07 4:37 
GeneralRe: List box loop? Pin
nlarson1123-Jan-07 6:22
nlarson1123-Jan-07 6:22 
GeneralRe: List box loop? Pin
China-Gary23-Jan-07 8:47
China-Gary23-Jan-07 8:47 
GeneralRe: List box loop? Pin
nlarson1123-Jan-07 9:04
nlarson1123-Jan-07 9:04 
GeneralRe: List box loop? Pin
China-Gary23-Jan-07 9:08
China-Gary23-Jan-07 9:08 
QuestionStop Windows going to sleep while app is running Pin
The8at23-Jan-07 1:54
The8at23-Jan-07 1:54 
AnswerRe: Stop Windows going to sleep while app is running Pin
Dave Kreskowiak23-Jan-07 5:26
mveDave Kreskowiak23-Jan-07 5:26 
QuestionCustomize Setup for Vb.net Project Pin
Amit Gorawadia23-Jan-07 1:31
Amit Gorawadia23-Jan-07 1:31 
QuestionScheduling an Event on Developer Express Pin
Bright267723-Jan-07 1:24
Bright267723-Jan-07 1:24 
AnswerRe: Scheduling an Event on Developer Express Pin
Dave Kreskowiak23-Jan-07 5:12
mveDave Kreskowiak23-Jan-07 5:12 
QuestionRe: Scheduling an Event on Developer Express Pin
Bright267723-Jan-07 16:53
Bright267723-Jan-07 16:53 
AnswerRe: Scheduling an Event on Developer Express Pin
Dave Kreskowiak24-Jan-07 2:29
mveDave Kreskowiak24-Jan-07 2:29 
QuestionCapture Data From a TCP/IP Address-Port Pin
Ian Woods22-Jan-07 23:57
Ian Woods22-Jan-07 23:57 
AnswerRe: Capture Data From a TCP/IP Address-Port Pin
Dave Kreskowiak23-Jan-07 5:11
mveDave Kreskowiak23-Jan-07 5:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.