0

我有一个程序,它有许多用户可以输入数据的字段,还有一些用户可以从中选择数据的组合框。

我的问题是是否可以使用这些选定的数据来填充一个列表框或多个列表框(每个字段一个)。

我目前有这个填充组合框的代码:

    Private Sub BusinessSalesPage_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.ComboBox1.Items.AddRange(New String() {"0", "1-2", "3-9", "10-19", "20-49", "50-99", "100+"})
    Me.ComboBox2.Items.AddRange(New String() {"0", "0-1", "2-4", "5+"})
    Me.ComboBox3.Items.AddRange(New String() {"<£1k", "£1k-£5k", "£5k-£10k", "£10k-£29k"})
    Me.ComboBox4.Items.AddRange(New String() {"1-10", "10-20", "20-50"})
    Me.ComboBox5.Items.AddRange(New String() {"<£50k", "£50k-£100k", "£100k-£250k"})
    Me.ComboBox6.Items.AddRange(New String() {"Limited", "Partnership", "PLC"})
    Me.ComboBox7.Items.AddRange(New String() {"Established more than 5 years", "Established in 2007", "Established in 2008", "Established in 2009"})
    Me.ComboBox8.Items.AddRange(New String() {"CEO", "Deputy Head", "Manager", "Other"})
    Me.ComboBox9.Items.AddRange(New String() {"Marketing", "Energy Provider", "Retail", "IT"})
    Me.ComboBox10.Items.AddRange(New String() {"Post Code", "Account Number", "Phone Number", "Business Name"})
End Sub

是的,我是 VB 的新手,在此先感谢。

值得注意的是,我正在使用 TabPages 浏览表单。

编辑:

我只想从一个文本框获取用户输入并将其显示到一个列表框中这是我目前所拥有的:

    Dim postcode As String = String.Empty

    postcode = TextBox16.Text

    If postcode = "" Then
        MessageBox.Show("Please enter a postcode")
    Else

    End If

不确定需要进入 ElseIf 什么才能使 inout 进入 ListBox1

4

1 回答 1

0

你只需要在下面

        listbox1.Items.Add(postcode)
于 2013-04-02T18:10:58.577 回答