Hi,

currently I am creating a seat plan system.
On my seat plan system, there are many workstations(around 150+ per floor). each workstation is define by a linklabel. when a user click on a particular workstation, a new form will appear. And that form will pop up to show who occupy on that workstation.

And here is my problem,. On my form where I have many linklabels.. I also have a textbox to search for a particular linklabel name,.And if I the user enter the name of the workstation name..the linklabel will change it's background color.

Not that one..what if ill type the name of the linklabel on the textbox. Then that textbox will search if that linklabel is available on the same form. if the linklabel is available, then the searched linklabel will change its background property

Hi,

dim MyLabel as linklabel

MyLabel = form1.findcontrol(Textbox1.text)
If MyLabel isnot nothing then
  MyLabel.BackColor = Red
End if

thanks dude!
i attached the picture of my project..and that is how it looks like

i have problem on the code that you provided.,it says that findcontrol is not a member of WindowsApplication1.frmSeat23

in the upper part..that is my search box for my linklabel(or workstation)

thanks dude!
i attached the picture of my project..and that is how it looks like

Looks nice, glad I could help - don't forget to mark as solved....

Also, you may wnt to loop through the individual LinkLabel controls and reset their colours before setting the target one, incase the user has already selected one person then selects another.

i thought it actually solve., but i have problem on the code that you provided.,it says that 'findcontrol is not a member of WindowsApplication1.frmSeat23'

what is/are possible solution/s for this one?

im sorry dude..im a newbie in vb.net

dude...

"DUDE!!!", what's the hurry, we're not getting paid here. :D

See if this helps.

If Not CType(Me.Controls(TextBox1.Text), LinkLabel) Is Nothing Then
            With CType(Me.Controls(TextBox1.Text), LinkLabel)
                .BackColor = Color.Orange
            End With
        End If

Nice app. btw.:)

thanks codeorder
..hehe..it's already working well..this is my new code

Dim wrkStn As String

wrkStn = String.Concat("lbl", (txtSearch.Text.ToUpper))

        If Not CType(Me.Controls(wrkStn), LinkLabel) Is Nothing Then
            With CType(Me.Controls(wrkStn), LinkLabel)
                .BackColor = Color.Orange
            End With
        End If

thanks codeorder and G_Wandell

thanks codeorder
..hehe..it's already working well..this is my new code

Dim wrkStn As String

wrkStn = String.Concat("lbl", (txtSearch.Text.ToUpper))

        If Not CType(Me.Controls(wrkStn), LinkLabel) Is Nothing Then
            With CType(Me.Controls(wrkStn), LinkLabel)
                .BackColor = Color.Orange
            End With
        End If

Hi,

First of all... Dude I'm at work! a bit of patience or you could pay me €50+K a year plus pension and health benefits and I'll work for you.

Second - my bad, Findcontrol is what you use on webpages -DOH!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.