Solved

How to pick item from listbox and drop to textbox

Posted on 2009-07-03
7
551 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

17 Experts available now in Live!

Get 1:1 Help Now