Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 236
  • Last Modified:

How to iterating through a visual net 2005 toolstrip

Greetings,

First I need to iterate through the controls in a toolstrip.  Second, when the control is a combobox, I need to read the value.  

Thanks
0
vaughnwhitehead
Asked:
vaughnwhitehead
1 Solution
 
TommyTwoPintsCommented:
Hello vaughnwhitehead,

The below sample will help you achieve what you want.

Regards,

TommyTwoPints
    Sub LoopThroughToolStrip()
        Dim TS As ToolStrip = Me.ToolStrip1
        For Each item As ToolStripItem In TS.Items
            If TypeOf item Is ToolStripComboBox Then
                MessageBox.Show(DirectCast(item, ToolStripComboBox).Text)
            End If
        Next
    End Sub

Open in new window

0
 
vaughnwhiteheadAuthor Commented:
Greatly appreciate the fast response on such a basic question.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now