Twice click ComboBoxgadget

Just starting out? Need help? Post your questions and find answers here.
Little_man
Enthusiast
Enthusiast
Posts: 152
Joined: Fri Mar 29, 2013 4:55 pm
Location: The Netherland

Twice click ComboBoxgadget

Post by Little_man »

Hi all,

When starting the program, the ComboBoxgadget is "unfolded".
The following problem with unfolded" ComboBox;
If I now want to close the program, I have to click twice on the Button "End Program".

How to adjust "unfolded" comboBox only clicking the Button "End Program" once?

With kind regards,
Little_man

Code: Select all

EnableExplicit

;- Opsommingen
Enumeration Window
  #Window
EndEnumeration

Enumeration Gadgets
  #Combo
  #End_Program
EndEnumeration

Procedure Main()
  OpenWindow(#Window, 0, 0, 250, 200, "Test Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    Protected.i A
  
    ComboBoxGadget(#Combo, 50, 25, 150, 22)
    For A = 1 To 5
      AddGadgetItem(#Combo, -1,"ComboBox item " + Str(A))
    Next

    ButtonGadget(#End_Program, 50, 170, 150, 25, "End Program")
    
    SendMessage_(GadgetID(#Combo), #CB_SHOWDROPDOWN, 1, 0)
    SetCursor_(LoadCursor_(0, #IDC_ARROW))

    SetGadgetState(#Combo, 2)
EndProcedure

Main()

;- Event Loop
Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break

      ;-> Event Gadget
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #End_Program   ;End Program.
          ;MessageRequester("Information", "Buttonname: End_Program" + #CRLF$ + #CRLF$ + "Test : " + GetGadgetText(EventGadget()))
          End
      EndSelect

  EndSelect
ForEver
User avatar
mk-soft
Always Here
Always Here
Posts: 6253
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Twice click ComboBoxgadget

Post by mk-soft »

This is not possible because the window does not yet have the focus when you first click on close.
Is Window Internal.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply