We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

How to pick item from listbox and drop to textbox

jtran007
jtran007 asked
on
Medium Priority
598 Views
Last Modified: 2012-05-07
Hi expert,

I'd like to select an item from listbox and drop to textbox.
How can I do it?
Thks.
JT
Comment
Watch Question

Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
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.
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.

Author

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
Jaime OlivaresSoftware Architect
CERTIFIED EXPERT
Top Expert 2008

Commented:
but still you have not indicated which GUI library are you using..

Author

Commented:
HI expert,
i am using visual stusio 2008, and winform

Thks,
JT
Software Architect
CERTIFIED EXPERT
Top Expert 2008
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Thanks,
JT
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.