W
Wally
I need to browse all ITEMS of a ListBox and all ITEMS of a ComboBox.
I wrote 2 distinct Sub that are almost identical. The difference is only the
object type. How could I browsing ITEMS using only one Sub with object as
parameter?
Here, my two Subs. Thanks
Private Sub AnalyzeListBox()
Dim sText as String
Dim objCtrl As System.Windows.Forms.ListBox = Form1.ListBox1
For i = 0 To objCtrl.Items.Count - 1
Dim objNewElement As New OneElement
sText = objCtrl.Items(i).ToString
Console.WriteLine(sText)
Next
End Sub
Private Sub AnalyzeComboBox()
Dim sText as String
Dim objCtrl As System.Windows.Forms.ComboBox = Form1.ComboBox1
For i = 0 To objCtrl.Items.Count - 1
Dim objNewElement As New OneElement
sText = objCtrl.Items(i).ToString
Console.WriteLine(sText)
Next
End Sub
I wrote 2 distinct Sub that are almost identical. The difference is only the
object type. How could I browsing ITEMS using only one Sub with object as
parameter?
Here, my two Subs. Thanks
Private Sub AnalyzeListBox()
Dim sText as String
Dim objCtrl As System.Windows.Forms.ListBox = Form1.ListBox1
For i = 0 To objCtrl.Items.Count - 1
Dim objNewElement As New OneElement
sText = objCtrl.Items(i).ToString
Console.WriteLine(sText)
Next
End Sub
Private Sub AnalyzeComboBox()
Dim sText as String
Dim objCtrl As System.Windows.Forms.ComboBox = Form1.ComboBox1
For i = 0 To objCtrl.Items.Count - 1
Dim objNewElement As New OneElement
sText = objCtrl.Items(i).ToString
Console.WriteLine(sText)
Next
End Sub