Dragging text into richtextbox

realphx
06-05-2005, 12:04 PM
Hello, i want my program to have a feature where they can drag a letter from a menu into the richtextbox, and that will automatically add that letter into the rich textbox. For example, the letters are special characters with accent marks on them. I want the user to be able to add one while typing something into the richtextbox. How would i do this??

Gruff
06-05-2005, 12:39 PM
The richtextbox like many of the standard vb6 controls has OLEDrag and OLEDrop properties. If by 'menu' you mean a standard listbox control then It too has the same properties. Do a search for OLEDragDrop.

Basically there are two ways.

1) Automatic
2) Manual

Automatic is easy to set up but doesn't always do what you intend.
Manual is a bit more tedious to set up as you have to write the code for what you want to happen on the StartDrag and the Drop, but is totally configurable by you.

In both cases the controls have quite a few OLEDrag 'events' that allow you to monitor (and change) the drag process.

The DragIcon can be set to display a custom icon when dragging is in progress.

VB6 help has some very clear examples on how to do it. Also if you use the Forum special advanced search at the top of this page you should find more.

~Tom

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum