Code: Select all
Select EventType()
Case #PB_EventType_Focus
SendMessage_(hAnyEditControl, #EM_SETSEL, 0, -1) ; <------------
EndSelect
Code: Select all
Select EventType()
Case #PB_EventType_Focus
SendMessage_(hAnyEditControl, #EM_SETSEL, 0, -1) ; <------------
EndSelect
What an attitude! Anyway, the answer is obvious: so that the user has the option of repeating the same text, or typing new type without manually deleting it all first. Just like the PureBasic search/replace dialog box.Derren wrote:The question is why?
Code: Select all
OpenWindow(0,0,0,300,100,"",#PB_Window_SystemMenu)
ComboBoxGadget(0,0,0,300,20,#PB_ComboBox_Editable)
SetGadgetText(0,"Search And Replace Dialogue Behaviour")
SetActiveGadget(0)
Repeat
Until WaitWindowEvent(20) =#PB_Event_CloseWindow
Code: Select all
OpenWindow(0, 0, 0, 300, 100, "test",#PB_Window_SystemMenu)
StringGadget(0, 5, 5, 200, 20, "Phonenumber Area Code e.g. 123")
Repeat
Select WaitWindowEvent(20)
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
If EventGadget()=0 And EventType()=#PB_EventType_Focus
SetGadgetText(0, "")
EndIf
EndSelect
ForEver
Code: Select all
hMainWnd = OpenWindow(1, 0,0, 500, 300, "test", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
dwExStyle = #Null
dwStyle = #WS_CHILD|#WS_VISIBLE|#WS_BORDER|#CBS_DROPDOWN
hCombo = CreateWindowEx_(dwExStyle, #WC_COMBOBOX, @"", dwStyle, 10, 10, 300, 20, WindowID(1), 1, GetModuleHandle_(#Null), 0)
hString = StringGadget(2, 10, 40, 300, 20, "")
Repeat : Until WaitWindowEvent() = 16