以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  复选列表框取值?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=29087)

--  作者:红颜
--  发布时间:2013/2/27 11:36:00
--  复选列表框取值?

Dim clb As WinForm.CheckedListBox = e.form.Controls("CheckedListBox1")
clb.Combolist = DataTables("明细表").GetComboListString("品名","打印 = 0")

 

1、上述代码将排除重复的“品名”,如何不排除重复的“品名”。

 

2、如何多列显示,如同时显示“编号,品名”,在一行显示。


--  作者:狐狸爸爸
--  发布时间:2013/2/27 11:41:00
--  

参考:
 
http://www.foxtable.com/help/topics/0392.htm


 
Dim Arys As List(Of String())

Dim clb As WinForm.CheckedListBox = e.form.Controls("CheckedListBox1")
Arys = DataTables("订单").GetUniqueValues("打印 = 0", "编号","品名")
For Each Ary As String() In Arys

    clb.items.Add(ary(0) & "," & ary(1))
Next


--  作者:红颜
--  发布时间:2013/2/27 15:12:00
--  
以下是引用狐狸爸爸在2013-2-27 11:41:00的发言:

参考:
 
http://www.foxtable.com/help/topics/0392.htm


 
Dim Arys As List(Of String())

Dim clb As WinForm.CheckedListBox = e.form.Controls("CheckedListBox1")
Arys = DataTables("订单").GetUniqueValues("打印 = 0", "编号","品名")
For Each Ary As String() In Arys

    clb.items.Add(ary(0) & "," & ary(1))
Next

 

 



 

请教:看了帮助,有些地方不明白。0和1是什么意思?如果提取从3列或4列,clb.items.Add(ary(0) & "," & ary(1))有何变化?


--  作者:狐狸爸爸
--  发布时间:2013/2/27 15:14:00
--  

这属于编程基础,看看数组这一节:

 

http://www.foxtable.com/help/topics/0216.htm

 


--  作者:红颜
--  发布时间:2013/2/27 16:18:00
--  

原来是这样:

 

Dim clb As WinForm.CheckedListBox = e.form.Controls("CheckedListBox1")
Dim Arys As List(Of String())
Arys = DataTables("SFMX").GetUniqueValues("打印 = 0 And [客户]=\'"& Tables("明细表").Current("客户") &"\'", "编号","客户","产品名称")
For Each Ary As String() In Arys   
    clb.items.Add(ary(0) & "," & ary(1) & "," & ary(2))

Next

 

0=编号;1=客户;2=产品名称