0

I have a listbox with items and a panel. What I want to do is when I click on an item, a label shows up in a panel, which was already there before the item was clicked. I've managed to show the label, but it didn't add to the panel, instead went to the back of the panel. How could I fix this? I've already tried to code the label to bring it to front, but it didn't work.
Here is the code I have so far:

Dim MyLinkLabel As New Label()
        With MyLinkLabel
            .Location = New Point(205, 90)
            .Visible = True
            .AutoSize = True
        End With

        Me.controls.add(MyLinkLabel)
        MyLinkLabel.Text = "Information"

        Dim myfont As New Font("Mistral", 23, FontStyle.Regular)
        MyLinkLabel.Font = myfont
2
Contributors
2
Replies
12
Views
3 Years
Discussion Span
Last Post by Start4me
0

You have to add it to the panel, not the form as in

pnlMyPanel.Controls.Add(MyLinkLabel)

Edited by Reverend Jim

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.