Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ComboBox open and close programatically
#3
Ahhh. For some silly reason, I checked stack overflow but didn't go directly to MSDN. I am a big boy now and should be able to do some of these things myself!

https://msdn.microsoft.com/en-us/library...s.85).aspx

Here are a few CB extensions from just a few minutes of work on the MSDN site:


Function CB_ShowDropDown
Code:
Copy      Help
;/
function# hwnd [flags] ;;flags: 0 open dropdown (default), 1 close dropdown


;;Show or hide the list box of a combo box that has the CBS_DROPDOWN or CBS_DROPDOWNLIST style.


;hwnd - control handle.
if(flags&1)
,SendMessage(hwnd CB_SHOWDROPDOWN 0 0)
else
,SendMessage(hwnd CB_SHOWDROPDOWN 1 0)


Function CB_GetDroppedState
Code:
Copy      Help
;/
function# hwnd


,;Determines whether the list box of a combo box is dropped down.

;hwnd - control handle.
ret SendMessage(hwnd CB_GETDROPPEDSTATE 0 0)
,

Function CB_ToggleDroppedState
Code:
Copy      Help
;/
function# hwnd


,;Toggles dropped state of list box of a combo box

;hwnd - control handle.
;Return value = toggled state (1 open, 2 closed)

if(SendMessage(hwnd CB_GETDROPPEDSTATE 0 0))
,CB_ShowDropDown(hwnd 1)
,ret 0
else
,CB_ShowDropDown(hwnd)
,ret 1
,
,


Function CB_SetItemHeight
Code:
Copy      Help
;/
function# hwnd CbComponent height;; CbComponent: -1 set height of selection field, 0 height of list items, zero-based index of a specific list item (combo box must have CBS_OWNERDRAWVARIABLE style).

;Set height of list items or selection field in a combo box

;Returns 0 if successfully set, -1 if error
,
;hwnd - control handle.

ret SendMessage(hwnd CB_SETITEMHEIGHT CbComponent height)

,


I could do more when I have more time.
Stuart


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)