DarkBoost Posted December 31, 2010 Posted December 31, 2010 I love the default combo style that you can scroll through your list if it exceeds the height. I also love the static text list which is the style I want to use but this does not allow you to scroll through the list if it exceeds the height. So my post/question is can I combine Style A and B = see example expandcollapse popup#include <GUIConstantsEx.au3> #include <ComboConstants.au3> #include <StaticConstants.au3> Global $list, $min = 32, $max = 1920, $step = 16 For $a = $min To $max Step $step If $a <> $max Then $list &= $a & "|" If $a = $max Then $list &= $a Next GUICreate("ComboList", 300, 135) GUISetFont(8, "", "", "verdana") ;Style A GUICtrlCreateCombo("", 10, 10, 80, 20) GUICtrlSetData(-1, $list, "1024") GUICtrlCreateLabel("Style A - default style", 100, 10, 190, 20, $SS_CENTERIMAGE) ;Style B GUICtrlCreateCombo("", 10, 50, 80, 20, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, $list, "1024") GUICtrlCreateLabel("Style B - static text list", 100, 50, 190, 20, $SS_CENTERIMAGE) ;Divider GUICtrlCreateLabel("", 10, 85, 280, 1) GUICtrlSetBkColor(-1, 0xCCCCCC) ;Style C GUICtrlCreateCombo("", 10, 100, 80, 20) ;Combine Style A + B here!!! GUICtrlSetData(-1, $list, "1024") GUICtrlCreateLabel("Style C - Style A + B combined", 100, 100, 190, 20, $SS_CENTERIMAGE) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE
AdmiralAlkex Posted December 31, 2010 Posted December 31, 2010 Look at the default styles, "$CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL", could it be any of these? VSCROLL sounds interesting.Try it:expandcollapse popup#include <GUIConstantsEx.au3> #include <ComboConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Global $list, $min = 32, $max = 1920, $step = 16 For $a = $min To $max Step $step If $a <> $max Then $list &= $a & "|" If $a = $max Then $list &= $a Next GUICreate("ComboList", 300, 135) GUISetFont(8, "", "", "verdana") ;Style A GUICtrlCreateCombo("", 10, 10, 80, 20) GUICtrlSetData(-1, $list, "1024") GUICtrlCreateLabel("Style A - default style", 100, 10, 190, 20, $SS_CENTERIMAGE) ;Style B GUICtrlCreateCombo("", 10, 50, 80, 20, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, $list, "1024") GUICtrlCreateLabel("Style B - static text list", 100, 50, 190, 20, $SS_CENTERIMAGE) ;Divider GUICtrlCreateLabel("", 10, 85, 280, 1) GUICtrlSetBkColor(-1, 0xCCCCCC) ;Style C GUICtrlCreateCombo("", 10, 100, 80, 20, BitOR($WS_VSCROLL, $CBS_DROPDOWNLIST)) ;Combine Style A + B here!!! GUICtrlSetData(-1, $list, "1024") GUICtrlCreateLabel("Style C - Style A + B combined", 100, 100, 190, 20, $SS_CENTERIMAGE) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSEStyles is combined with BitOR in case you didn't know.There is a tutorial on setting styles here. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
DarkBoost Posted December 31, 2010 Author Posted December 31, 2010 argh... i keep forgetting that you can combine certain styles even when they are not listed under the specific functions advanced options. thanks!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now