Jump to content
Sign in to follow this  
1nsan1ty

GUICreateCombo With background not working.

Recommended Posts

1nsan1ty

Hey all,

Not sure if it's a bug or the code, but if you have a GUI with a background jpg the GUICreatecombo will not dropdown even if you use the styles. but, if you remove the background picture the combo box works as it should.

Example which works:

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $msg
    GUICreate("My GUI combo",220,50)  ; will create a dialog box that when displayed is centered
;GUICtrlCreatePic("school.jpg", 0, 0, 300,50)
    GUICtrlCreateCombo("item1", 10, 10,200) ; create first item
    GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example

Then with a background (combobox does not work):

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $msg
    GUICreate("My GUI combo",220,50)  ; will create a dialog box that when displayed is centered
    GUICtrlCreatePic("school.jpg", 0, 0, 300,50)
    GUICtrlCreateCombo("item1", 10, 10,200) ; create first item
    GUICtrlSetData(-1, "item2|item3", "item3") ; add other item snd set a new default

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example
Edited by 1nsan1ty

Share this post


Link to post
Share on other sites
AdmiralAlkex

And what does the helpfile say in the "Remarks"-section under GUICtrlCreatePic?

If a picture is set as a background picture, as the other controls will overlap, it's important to disable the pic control and create it after the others controls: GuiCtrlSetState(-1,$GUI_DISABLE). This is not enough for Tab or Listview control which behave differently. In this case you need to create the picture with the $WS_CLIPSIBLINGS style, GuiCtrlSetState(-1,$GUI_ONTOP) is necessary for the Tab, TreeView or Listview control.

Share this post


Link to post
Share on other sites
1nsan1ty

Thanks. I was looking at the website, not the helpfile

Edited by 1nsan1ty

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.