listbox

CRP

Member
Joined
Oct 30, 2007
Messages
11
Programming Experience
3-5
I have a listbox server control where i have added items as 10, 12 and 14. I have a label server control in my form. Whenever i click the items in the listbox, the size of the label should get changed according to the size (number) selected in the listbox. for e.g when i choose 10 in the list box, then the size of the label should be 10 point size. Give me the code in vb.net. In which event of listbox should i do the coding?
 
Firstly I'm confused what you mean by "server control". I'm not sure what servers have to do with anything here. A control is a control.
VB.NET:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, _
                                          ByVal e As EventArgs) Handles ListBox1.SelectedIndexChanged
    Me.Label1.Text = Me.ListBox1.SelectedItem.ToString()
End Sub
I suggest that you read the MSDN documentation for the ListBox class before going any further, and that you do similar for any other classes you have questions about in future.
 
Back
Top