Foxtable(狐表)用户栏目专家坐堂 → 下拉窗口问题


  共有2514人关注过本帖树形打印复制链接

主题:下拉窗口问题

帅哥哟,离线,有人找我吗?
wh420
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1107 积分:10574 威望:0 精华:0 注册:2014/2/19 16:32:00
下拉窗口问题  发帖心情 Post By:2020/8/27 17:43:00 [只看该作者]

下拉窗口的afterload事件为:
Dim Products As List(Of String)
Products = DataTables("Table_JieSuan").SQLGetValues("ShouKuanTitle")
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw() '暂停绘制
lvw.View = ViewMode.SmallIcon '显示模式为小图标
For Each Product As String In Products
    'Dim Key As String = dr("图标")
    Dim r As  WinForm.ListViewRow =  lvw.Rows.Add() '增加一行
    lvw.Images.AddSmallImage("Man", "Man48.ico") '添加代表这个国家的小图标
    r.ImageKey = "Man" '指定图标键值
    r.Text = product
    r.Tag = Products '将对应的Datarow赋值给tag属性,方便在其他事件中调用
Next
lvw.ResumeRedraw() '恢复绘制


listview1控件的RowActivate事件中的代码应该如何写能实现双击某条记录自动填充其他字段值。(下面代码报错:可能跟TAG属性有关)

Dim lvw As WinForm.ListView = e.Sender
Dim dr As DataRow =  lvw.Current.tag
Dim r As Row = e.Form.DropTable.Current
r("YiYuanName") = dr("YiYuanName")

e.Form.DropDownBox.Value = dr("ShouKuanTitle")
e.Form.DropDownBox.CloseDropdown()



 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107813 积分:548416 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/8/27 20:04:00 [只看该作者]

 加上必要的判断

Dim lvw As WinForm.ListView = e.Sender
if lvw.Current is nothing then return
Dim dr As DataRow =  lvw.Current.tag
……

 回到顶部