SendMessage_(GadgetID(#Iban_1), #EM_SETSEL, 0, -1)

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Posts: 51
Joined: Wed Mar 18, 2015 5:52 am

SendMessage_(GadgetID(#Iban_1), #EM_SETSEL, 0, -1)

Post by loulou2522 »

Is there an equivalent from SendMessage_(GadgetID(#Iban_1), #EM_SETSEL, 0, -1) in Purebasic
THanks
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: SendMessage_(GadgetID(#Iban_1), #EM_SETSEL, 0, -1)

Post by falsam »

Code: Select all

Procedure GadgetSelectionRange(gadget, startPos, endPos)
    Protected g = GadgetID(gadget)
    
    SetActiveGadget(gadget)
    
    ! const input = document.getElementById(v_g.gadget.id);
    ! input.setSelectionRange(v_startpos, v_endpos);
EndProcedure

Enumeration
  #mf
  #mfString1
  #mfString2
EndEnumeration

OpenWindow(#mf, 0, 0, 0, 0, "", #PB_Window_Background)

StringGadget(#mfString1, 10, 10, 100, 24, "String1")
StringGadget(#mfString2, 10, 40, 100, 24, "String2")

GadgetSelectionRange(#mfString2, 2, 5)    

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
Post Reply