I'm trying to move the cursor to the end of an edit box after my g-label triggers and removes the non-"a-z0-9" characters.
currently, the G-label triggers, removes the * from the string, and updates the editbox. but the cursor is back at the start of the box.
I know I could end the g-label with something like "Send ^{right}" to go to the end, but I feel like this is bodging it and opens me up for an unknown case causing issues later on.
Any help would be appreciated!
Thanks
SOLUTION
for anyone else with this issue:
Code: Select all
Gui, 2:add, Edit, x5 y5 h20 w150 vAddEditVehicleRegistration1 gAddEditVehicleRegistration1 limit10,
gui, 2:show h100 y200
return
AddEditVehicleRegistration1:
{
GuiControlGet, temp,,AddEditVehicleRegistration1
tempCursorPos := RegExMatch(temp, "[^a-zA-Z0-9]") - 1
if (tempCursorPos >= 0)
{
temp := RegExReplace(temp, "[^a-zA-Z0-9]", "")
;~ MsgBox,,,%tempCursorPos%
GuiControl, 2:-g, AddEditVehicleRegistration1
GuiControl, 2:, AddEditVehicleRegistration1, %temp%
temphwnd := xgc.hwnd
SendMessage, 0xB1, %tempCursorPos%, %tempCursorPos%,,ahk_id %temphwnd%
GuiControl, 2:+gAddEditVehicleRegistration1, AddEditVehicleRegistration1
}
return
}