Jump to content
Sign in to follow this  
Zed

Combo

Recommended Posts

Zed

Hello,

I want to try to create a combo in my gui but without that down arrow always next to it.

Im working in a little gui and I want to economize as much space as I can, and also make it have a nice look.

I searched in styles but I cant find a suitable one.

Can anyone help me if its possible pls?

Share this post


Link to post
Share on other sites
sandin
Zed

Then what style do you use to make a droplist?

Would be cool to get a full answer.

Edited by Zed

Share this post


Link to post
Share on other sites
sandin

well if you remove "down arrow" from combo how will you get drop list? you can't you can only switch with UP/DOWN keys on keyboard, and in guictrlcreateinput() you can do it this way:

#include <GUIConstants.au3>
#include <GuiEdit.au3>
$Form1 = GUICreate("Form1", 151, 65, 193, 125)
$Input1 = GUICtrlCreateInput("Input No.1", 8, 8, 60, 21, $ES_READONLY)
GUICtrlSetBkColor(-1, 0x454545)
Guictrlsetcolor(-1, 0xe98fb98)
$Label1 = GUICtrlCreateLabel("Press UP/DOWN while" & @CRLF & "input box is focused", 8, 32, 132, 41)
GUISetState(@SW_SHOW)
While 1
    if ControlGetFocus($Form1) = "Edit1" then
        HotKeySet("{up}", "InputToCombo")
        HotKeySet("{DOWN}", "InputToCombo")
    Else
        HotKeySet("{up}")
        HotKeySet("{DOWN}")
    EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
func InputToCombo()
    If ControlGetFocus($Form1, "") <> "Edit1" Then Return
    If @HotKeyPressed = "{UP}" Then
        if GUICtrlRead($Input1) = "Input No.1" Then
            GUICtrlSetData($Input1, "Input No.2")
        elseif GUICtrlRead($Input1) = "Input No.2" Then
            GUICtrlSetData($Input1, "Input No.3")
        EndIf
    Else
       if GUICtrlRead($Input1) = "Input No.3" Then
           GUICtrlSetData($Input1, "Input No.2")
       elseif GUICtrlRead($Input1) = "Input No.2" Then
           GUICtrlSetData($Input1, "Input No.1")
       EndIf
    EndIf  
EndFunc

Share this post


Link to post
Share on other sites
Zed

Not what I was looking for at all.

By setting the combo style to $DropDownList, you can get the droplist by also clicking the text area. You dont need the arrow at all.

What you provided is not a combo.

But ok, even if it was possible, if you cant do this with a basic function then its not as useful.

Tks for reply, bye.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×