C#从列表视图传递到其他形式的文本框 [英] C# pass from listview to textbox on other form

查看:157
本文介绍了C#从列表视图传递到其他形式的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我搜索并找到了几个示例,但我的软件没有成功.
我有2种形式,在form1中,我有一个复选框设置为true的列表框,此列表框填充了来自SQL的数据,直到那里都没有问题.
现在我要根据选中的项目单击确定",然后单击否form1",然后将项目传输到Form2中的文本框.
这些项目来自SQL,我已经测试了必要的查询.
我只是不知道如何将选中的项目传输到form2.

谁能指出我正确的方向?


提前谢谢.

我尝试过的事情:

在我的情况下,SQL查询为:

Hi,

I searched and found several examples but no sucess for my sofware.
I have 2 forms, in form1 i have a listbox with checkboxes set to true, this listbox is populated with data from SQL, no problems till there.
Now i want to depending on the checked item click OK no form1 and transport items to a textbox in Form2.
These items are from SQL and i have the necessary query tested.
I just cant figure out how to transport the checked item to form2.

Can anyone point me in the right direction?


Thanks in advance.

What I have tried:

In my case the sql query is:

select [desc] + ''  '' + [compo] from vidros

推荐答案

我发现在更改字段内容时这样做是个好主意:

I''ve found that it''s a good idea to do this when you''re changing the field contents:

select [desc] + ''  '' + [compo] AS Description from vidros


这篇关于C#从列表视图传递到其他形式的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆