1
使用System.Windows.Forms的我已经开始写这样的Visual Studio 2005中宏:在Visual Studio中宏
Public Sub myMacro()
Dim myListBox As New System.Windows.Forms.ListBox()
For Each x As String In xs
myListBox.Items.Add(x)
Next
但我在一个头绪来显示ListBox
很完全,
我想类似这样的InputBox例如行为:
Dim str As String = InputBox("title", "prompt")
正如我们所看到的InputBox
可以立即构建并显示在屏幕上,再一旦箱子关闭,就转动String
。
我想呼吁myListBox
以下方法xs
与String
小号填充它之后,但在ListBox
仍然没有出现在屏幕的:
myListBox.EndUpdate()
myListBox.Show()
我还试图建立一个System.Windows.Forms.Form
并添加按照与按钮here (under Examples, Visual Basic)的概述类似的方法,向其输入ListBox
。 form.ShowDialog()
电话再次没有出现。
您是否添加了对System.Windows.Forms程序集的引用?顺便说一句,我想你会需要详细说明,因为我真的不能看到ListBox和InputBox提示之间的任何关系。 – Cerebrus 2009-05-22 11:55:34