Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:请教SelectedIndex 转为字符的问题

1楼
yangming 发表于:2011/8/16 10:12:00

If e.Form.Controls("ListBox1").SelectedIndex >= 0 Then
e.Form.Controls("ListBox2").Items.Add(e.Form.Controls("ListBox1").SelectedIndex.ToString)
e.Form.Controls("ListBox1").Items.Remove(e.Form.Controls("ListBox1").SelectedIndex.ToString)
Else
MessageBox.Show("请选择一行数据!", "错误", MessageBoxButtons.ok, MessageBoxIcon.Warning)
End If

这是一个按钮代码,目的是将A列表框中选择的一行字符转移到B列表框中,并删除A列表框中的字符,现在出现两个问题。

1。红色的部分没有生效,在B列表框中出现的是数字,也就是所选的行的位置

2。紫色部分没有执行,也就是说“Remove”没起作用

请教如何解决?

2楼
狐狸爸爸 发表于:2011/8/16 10:40:00
If e.Form.Controls("ListBox1").SelectedIndex >= 0 Then
    e.Form.Controls("ListBox2").Items.Add(e.Form.Controls("ListBox1").SelectedItem)
    e.Form.Controls("ListBox1").Items.Remove(e.Form.Controls("ListBox1").SelectedItem)
Else
    MessageBox.Show("请选择一行数据!", "错误", MessageBoxButtons.ok, MessageBoxIcon.Warning)
End If
3楼
yangming 发表于:2011/8/16 11:20:00
谢谢,成功了,呵
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02148 s, 2 queries.