drag and drop into multiline textbox - HELP!!!! 
Author Message
 drag and drop into multiline textbox - HELP!!!!

all i am trying to do is drag and drop text items from a
listbox into a SPECIFIC location in a multiline textbox.  
so when the dragdrop event occurs i need to figure out
where the cursor is and what location in the textbox to
insert the text item.

i can get it to insert at the beginning of the textbox or
at the end of the textbox... but i can't figure out how to
get the cursor location of where it was dropped.

any ideas??

the following is my code:

Private Sub txtText_DragEnter(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles
txtText.DragEnter

      If (e.Data.GetDataPresent(DataFormats.Text)) Then
        e.Effect = DragDropEffects.Copy
      Else
        e.Effect = DragDropEffects.None
      End If

End Sub

Private Sub txtText_DragDrop(ByVal sender As
System.Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles
txtText.DragDrop

      sender.Text =  
e.Data.GetDataDataFormats.Text).ToString  & txtText.Text

End Sub



Mon, 01 Aug 2005 02:07:47 GMT  
 drag and drop into multiline textbox - HELP!!!!
for the application i am developing, i want to be able to
type a text message in a textbox, but also be able to drag
predefined phrases from a listbox into the text message in
the multiline textbox.....

thanks,
rachna

Quote:
>-----Original Message-----
>Wouldn't it be easier to use a listbox?


>> all i am trying to do is drag and drop text items from
a
>> listbox into a SPECIFIC location in a multiline
textbox.  
>> so when the dragdrop event occurs i need to figure out
>> where the cursor is and what location in the textbox to
>> insert the text item.

>> i can get it to insert at the beginning of the textbox
or
>> at the end of the textbox... but i can't figure out how
to
>> get the cursor location of where it was dropped.

>> any ideas??

>> the following is my code:

>> Private Sub txtText_DragEnter(ByVal sender As
>> System.Object, ByVal e As
>> System.Windows.Forms.DragEventArgs) Handles
>> txtText.DragEnter

>>       If (e.Data.GetDataPresent(DataFormats.Text)) Then
>>         e.Effect = DragDropEffects.Copy
>>       Else
>>         e.Effect = DragDropEffects.None
>>       End If

>> End Sub

>> Private Sub txtText_DragDrop(ByVal sender As
>> System.Object, ByVal e As
>> System.Windows.Forms.DragEventArgs) Handles
>> txtText.DragDrop

>>       sender.Text =  
>> e.Data.GetDataDataFormats.Text).ToString  & txtText.Text

>> End Sub

>.



Mon, 01 Aug 2005 04:11:07 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VBA Help with Drag/Drop and TextBox Change Event

2. Drag/Drop text to textboxes in other applications

3. Drag & drop file from desktop to textbox

4. Drag Drop in Rich Edit TextBox

5. Printing Multiline Textbox Help Needed.

6. help needed with Multiline textbox

7. Help - Textbox w/ multiline true becomes disabled

8. HELP:limiting # of lines in a Multiline Textbox

9. Help, Multiline TextBox

10. Help multiline textbox no chr(13) at the end off a line

11. TreeView Drag n Drop don't allow dropping a parent into a child

12. Detect Drop in Drag and Drop

 

 
Powered by phpBB® Forum Software