Highlight Text

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TeddyLM.

How can I highlight whatever is in a TextGadget or a StringGadget when it gains focus.
I did it before using the Visual Basic functions SelStart and SelLength. But I didn't find such commands in PB !!
Some help would be nice.

Thanks


TeddyLM
A new registered PB-User

(... a long long way from home)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Pupil.

Test this on your stringgadget, havent testes on text gadget.

Code: Select all

; this is in you event loop
  ...
  case #YourStringGadget
    if EventType() = #PB_EventType_Focus
      SendMessage_(GadgetID(#YourStringGadget), #EM_SETSEL, 0, -1)
    endif
  ...
endselect
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by TeddyLM.

Great !
That's what I was looking for !!

Thanks Pupil

I owe you one !


New registered PB-Apprentice

(... a long long way from home)
Post Reply