• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

How to pick item from listbox and drop to textbox

Hi expert,

I'd like to select an item from listbox and drop to textbox.
How can I do it?
Thks.
JT
0
jtran007
Asked:
jtran007
  • 3
  • 3
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
winforms? webforms? wpf? silverlight?
as a general rule, there are a SelectedItem and a SelectedIndex properties you can use to select desired item.

about "drop to textbox", I didn't understand what you mean.
0
 
vaibhav_dwCommented:
yes you can use the SelectedItem.Text or SelectedValue.ToStribg() to access the current selected items from list box. You can assign the selected thing to text box as TextBox1.Text. Make sure to use .ToString() for the selected value if it is not of type string.
0
 
jtran007Author Commented:
Hi expert,

jaime: what i mean is that i have a list of files in the listbox. Then I can use a mouse to select one file
in the listbox, and drag it into a textbox where my program can read.

Thanks,
JTran
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Jaime OlivaresSoftware ArchitectCommented:
but still you have not indicated which GUI library are you using..
0
 
jtran007Author Commented:
HI expert,
i am using visual stusio 2008, and winform

Thks,
JT
0
 
Jaime OlivaresSoftware ArchitectCommented:
Drag and drop is not a trivial task in winforms.
Although this article clearly describes this complex operation, it is for .net 1.1, so maybe you will ned some modifications:
http://www.codeproject.com/KB/shell/dragdropharsha.aspx
0
 
jtran007Author Commented:
Thanks,
JT
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now