Page 1 of 1

Select and delete a text in a string gadget

Posted: Tue Jun 01, 2004 10:06 pm
by Armoured
Hi :D
How I can select a small portion of a text in a StringGadget and after delete him? :?

Thanks.

Posted: Tue Jun 01, 2004 10:13 pm
by The seperator
Have you tried the SendMessage_() function?
You can find more information about it in the win32 api guide

Posted: Tue Jun 01, 2004 10:45 pm
by The seperator
for example:

SendMessage_(GadgetID(;Your gadget;),#WM_CUT,0,0)

will delete the selected text and copy it to the clipboard.
This works for the rich editor. Haven't tested it yet on a string gadget but
normaly it should work.

Posted: Wed Jun 02, 2004 5:16 am
by Armoured
Hi :D
I have used this:

SendMessage_(GadgetID(#StringGadget),#WM_CLEAR,0,0)

will delete the selected text and nothing is copied to the clipboard 8)

Thanks again "The seperator". :wink:

Posted: Wed Jun 02, 2004 9:06 am
by Fred
If you want to delete only a little portion of the text you can use this:

Code: Select all

      SendMessage_(GadgetID(#StringGadget), #EM_SETSEL, 2, 5) ; select the chars from 2 to 5
      SendMessage_(GadgetID(#StringGadget), #WM_CUT, 0, 0) ; Cut it and place it in the clipboard