Selecting and dragging text on a TextBox

  • Thread starter Thread starter Abubakar
  • Start date Start date
A

Abubakar

Hi,
In a normal Windows.Forms.TextBox control, I want to be able to select a
text (ie highlight, this is by default possible) and than be able to drag
that text through my mouse pointer to another textbox, or any control, than
drop it. How do v do this?

Regards,

...ab
 
Hi,
I've followed the article and it explains pretty nicely how to do drag n
drop. But there is one thing I'm unable to manage and thats the selecting
and dragging text from TextBox. Its just the selecting from mouse thats a
problem. I highlight from the mouse in a TextBox and thats easy but as soon
as I do a mouse-down on the selected text with tthe purpose of moving it to
the other TextBox, the highlighting is removed and the text cursor starts
blinking exactly in the place where clicked to drag the text out from.
Unable to handle this...

...ab

Nicholas Paldino said:
Abubakar,

You will want to check out the section of the MSDN documentation titled
"Performing Drag-and-Drop Operations in Windows Forms", located at:

http://msdn2.microsoft.com/en-us/library/aa984430(VS.71).aspx

That example is very similar to what you want to do, with a little
tweaking, it should do exactly what you need it to do.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Abubakar said:
Hi,
In a normal Windows.Forms.TextBox control, I want to be able to select a
text (ie highlight, this is by default possible) and than be able to drag
that text through my mouse pointer to another textbox, or any control,
than drop it. How do v do this?

Regards,

..ab
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top