返回列表 上一主題 發帖

vba listbox ColumnHeads的表頭

vba listbox ColumnHeads的表頭

嗨,大家晚安 :

想請教一下VBA表單裡的listbox,切割好欄位後,怎麼新增表頭的文字上去,如下圖,

Google一些文章,都沒有看到合適的,特來請教大家,謝謝


    ___

回復  owenchen0911
listbox,切割好欄位後???

ListBox 要顯示ColumnHeads,清單的來源必需用.RowSour ...
GBKEE 發表於 2016-6-2 07:57



    Hi,

我的code如下,這樣子子項目可以加進去,那麼頭還可以用  "ColumnHeads"嗎??謝謝
  1. ListBox1.ColumnCount = 7
  2. ListBox1.ColumnHeads = True

  3. '增加項目進去
  4. IListRow = ListBox1.ListCount
  5.         ListBox1.AddItem ComboBox_drink_name
  6.         
  7.         ListBox1.List(IListRow, 1) = priceArray(ComboBox_drink_name.ListIndex)
  8.         ListBox1.List(IListRow, 2) = ComboBox_number
  9.         ListBox1.List(IListRow, 3) = ComboBox_number * priceArray(ComboBox_drink_name.ListIndex)
  10.         ListBox1.List(IListRow, 4) = ComboBox_ice
  11.         ListBox1.List(IListRow, 5) = ComboBox_sugar
  12.         ListBox1.List(IListRow, 6) = ComboBox_takeout
  13.         
  14.         xItemCount = xItemCount + 1
複製代碼

TOP

        靜思自在 : 【時間如鑽石】時間對一個有智慧的人而言,就如鑽石般珍貴;但對愚人來說,卻像是一把泥土,一點價值也沒有。
返回列表 上一主題