I have started writing a Macro in Visual Studio 2005 like this:
Public Sub myMacro()
Dim myListBox As New System.Windows.Forms.ListBox()
For Each x As String In xs
myListBox.Items.Add(x)
Next
But I'm completely at a loss as to how to display the ListBox
,
I'd like behaviour similar to this InputBox example:
Dim str As String = InputBox("title", "prompt")
As we can see the InputBox
can be constructed and displayed on the screen immediately, returning a String
once the box is closed.
I tried called the following methods on myListBox
after populating it with the String
s in xs
, but the ListBox
still does not appear of the screen:
myListBox.EndUpdate()
myListBox.Show()
I have also tried creating a System.Windows.Forms.Form
and adding the ListBox
to it, following a similar approach to the one outlined for a button here (under Examples, Visual Basic). Again nothing appears on the form.ShowDialog()
call.