Solved

How to pick item from listbox and drop to textbox

Posted on 2009-07-03
7
558 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

776 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