Solved

How to pick item from listbox and drop to textbox

Posted on 2009-07-03
7
554 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
0
Comment
Question by:jtran007
  • 3
  • 3
7 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 24773855
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
 
LVL 1

Expert Comment

by:vaibhav_dw
ID: 24783770
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
 

Author Comment

by:jtran007
ID: 24790943
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 24791037
but still you have not indicated which GUI library are you using..
0
 

Author Comment

by:jtran007
ID: 24796848
HI expert,
i am using visual stusio 2008, and winform

Thks,
JT
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 24800951
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
 

Author Closing Comment

by:jtran007
ID: 31599645
Thanks,
JT
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now