PDA

Click to See Complete Forum and Search --> : Need help badly...


hhh
Sep 26th, 2004, 11:37 PM
I got this GUI

Time Status
0900 Available
1300 Available
1700 Available

The time is in labels and the status is in linklabel...

how do i when I click on the Available linklabel, besides the 0900...it should be able to return me the text 0900 or when I click the Available linklabel besides the 1300, it should return me the text 1300...

i cant use .tag() property as it is not inside compact framework...how should go about doing it...

This is how i create those labels and linklabels dynamically..

Dim x As Integer = 30
Dim y As Integer = 14
Dim a As Integer = 80
Dim b As Integer = 14
Dim i As Integer

For i = CInt(start) To CInt(endt) Step CInt(inc)
Dim newLinkLabel(i) As OpenNETCF.Windows.Forms.LinkLabel
Dim newLabel(i) As Windows.Forms.Label
newLinkLabel(i) = New OpenNETCF.Windows.Forms.LinkLabel
newLabel(i) = New Windows.Forms.Label
With newLinkLabel(i)
.Location = New Point(a, b)
.Visible = True
.Size = New Size(40, 20)
.Show()
.Text = "Book"
.Enabled = True

AddHandler newLinkLabel(i).Click, AddressOf newlinklabel_click
End With
Dim flag As Integer
With newLabel(i)
.Location = New Point(x, y)
.Visible = True

If i = start Then
.Text = start
Else
.Text = CStr(i)
End If

Dim counter As Integer = 0
For counter = 0 To time.Length - 1
If (time(counter) = newLabel(i).Text) Then
newLinkLabel(i).Text = "Booked"
newLinkLabel(i).Enabled = False
End If

Next

End With
GroupBox1.Controls.Add(newLinkLabel(i))
GroupBox1.Controls.Add(newLabel(i))
'MsgBox(newLabel(1).Text)
y = y + 17
b = b + 17
Next
End Function

Sub newlinklabel_click(ByVal sender As Object, ByVal e As EventArgs)
End Sub

help will be greatly appreciated...

Mike Hildner
Sep 27th, 2004, 09:17 PM
No offense, but if you format your code I promise to help. Sorry, but I get a headache even looking at that.

Mike