Jump to content

_GuiCtrlComboBoxEx_CreateCombo


electrico
 Share

Recommended Posts

Dunno why but combo variants are not selectable. Exausted searching forum, please help if you can. Thank you.

Dont look at includes, as it is only small part of project.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <FTPEx.au3>
#include <Resources_udf.au3>
#include <EditConstants.au3>
#include <File.au3>
#include <HyperLinkInGui.au3>
#include <inet.au3>
#include <encoding_udf.au3>
#include <date.au3>
#include <Marquee.au3>
#include <winapi.au3>
#include <GDIPlus.au3>
#include <image_get_info.au3>
#include <array.au3>
#include <GuiEdit.au3>
#include <GuiComboBoxEx.au3>
#include <GuiImageList.au3>
Opt ("GuiOnEventMode", 1)
$mygui = GUICreate("test", 800, 600, 200, 100, BitOR($WS_POPUP, $WS_BORDER))
GUISetState(@SW_SHOW)
GUISetBkColor(0xffffff)
$button5 = GUICtrlCreateButton("X", 780, 0, 20, 20)
GUICtrlSetOnEvent($button5, "_Close")
    $hcombo = _GUICtrlComboBoxEx_Create($mygui, "", 605, 570, 65, 23, $CBS_DROPDOWNLIST)
    $hImage = _GUIImageList_Create (16, 16, 5, 3)
    For $x = 0 To 146
        _GUIImageList_AddIcon ($hImage, @SystemDir & "\shell32.dll", $x)
    Next
    _GUICtrlComboBoxEx_SetImageList ($hCombo, $hImage)
    _GUICtrlComboBoxEx_InitStorage ($hCombo, 150, 300)
    _GUICtrlComboBoxEx_BeginUpdate ($hCombo)
    For $x = 0 To 149
        _GUICtrlComboBoxEx_AddString ($hCombo, "", $x, $x)
    Next
    _GUICtrlComboBoxEx_EndUpdate ($hCombo)
Func _messagetogui()
    _SendMessage($mygui, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
EndFunc   ;==>_messagetogui
Func _Close()
    Exit
EndFunc   ;==>_Close
While 1
    Sleep(10)
WEnd

Edited by electrico
Link to comment
Share on other sites

A real brainer I ran into a while ago :graduated:. The control height defined in _GUICtrlComboBoxEx_Create() refers to the height of the drop-down! The actual height of the control is automatically set by the respective font size used (). So use something like this:

$hcombo = _GUICtrlComboBoxEx_Create($mygui, "", 605, 570, 65, 243, $CBS_DROPDOWNLIST)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...