• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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