将C#列表框选定的项目传递给另一种形式的文本框 [英] passing C# listbox selected item to textbox on another form

查看:259
本文介绍了将C#列表框选定的项目传递给另一种形式的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在执行HRIS项目,我编写了代码来搜索数据库记录并显示在列表框上.我想将选定的行传递给表单(而不是一个文本框)上的相应texbox.

i am doing HRIS project and i wrote code to search database records and display on a listbox.i want to pass the selected row to corresponding texboxes on a form not one textbox.

推荐答案

有很多方法,我发现最可靠的方法是基于接口的方法.
请参阅过去讨论中的我的答案"和其他答案"表格:
如何在列表框之间复制所有项目两种形式 [ ^ ]

—SA
There is a number of approaches, I find the most robust approach is the one based on interfaces.
Please see my Answer and other Answers form this past discussion:
How to copy all the items between listboxes in two forms[^]

—SA


这篇关于将C#列表框选定的项目传递给另一种形式的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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