【问题标题】:how to add an item to combobox so that my last added item should be shown at the top如何将项目添加到组合框,以便我最后添加的项目应显示在顶部
【发布时间】:2014-08-20 09:50:10
【问题描述】:

在 VB.net 中: 使用 combobox1.items.add(name) 将附加组合框项目。但我想查看组合框列表,最后添加的项目是第一个。截至目前,我将项目移动到一个数组中,然后使用 for 循环将值从最后一个移动到第一个。有没有捷径可以做到这一点?

代码:

        For i As Integer = (RC_Array.Length - 1) To 0 Step -1
            RC_Combobox.Items.Add(RC_Array(i)) 'Move the last value first
        Next

【问题讨论】:

    标签: vb.net combobox


    【解决方案1】:

    您可以使用ComboBox.Items.Insert(0,Item) 在组合框的第一个插槽中插入一个项目。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-11
      • 2018-02-05
      • 1970-01-01
      • 2017-11-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多