Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to pick item from listbox and drop to textbox

Posted on 2009-07-03
7
Medium Priority
?
579 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 750 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

636 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