Question Drop Down Question

r00t

New member
Joined
May 25, 2009
Messages
1
Programming Experience
1-3
Okay, so i need to do the following: I want to have a drop down menu with the values:
Year 7
Year 8
Year 9

And i want to display different tables for each the values selected in the drop down menu.

For example, when the "Year 7" value is selected in the drop down menu, a table is displayed for that year.

Anyone have an idea on how i can manage this?

Thanks,
Nicky.
 
well you can add the:
Year 7
Year 8
Year 9

to the Items collection but as for the data table(s) I dont know what the structure is for that.
 
To add the items:
VB.NET:
ToolStripMenuItem.DropDownItems.Add("Year 7")
ToolStripMenuItem.DropDownItems.Add("Year 8") 
ToolStripMenuItem.DropDownItems.Add("Year 9")
Then access them when clicked by:
VB.NET:
Private Sub ToolStripMenuItem_DropDownItemClicked(...)
  If e.ClickedItem.ToString = "Year 7" Then
     'Do something
  End If
End Sub
And like JuggaloBrotha said if we don't know the structure we can't help with that part.
 
To add the items:
VB.NET:
ToolStripMenuItem.DropDownItems.Add("Year 7")
ToolStripMenuItem.DropDownItems.Add("Year 8") 
ToolStripMenuItem.DropDownItems.Add("Year 9")
Then access them when clicked by:
VB.NET:
Private Sub ToolStripMenuItem_DropDownItemClicked(...)
  If e.ClickedItem.ToString = "Year 7" Then
     'Do something
  End If
End Sub
And like JuggaloBrotha said if we don't know the structure we can't help with that part.
I would suggest handling the Click events of the individual items unless there is a lot of commonality among the actions for each item.
 
Back
Top