Jump to content

need help with combo


is8591
 Share

Recommended Posts

I was trying to set-up a combo where user can only select from list items but when use $CBS_DROPDOWNLIST I loose the scrolldown bar so user can only pick from visible part of LIST.

User can still use arrow UP and Down to see the other parts of LIST but would be nice to have a scroll bar.

Anyone has any ideas?

Thank you.

Link to comment
Share on other sites

Here is the test code. Is there any mistakes?

#include <GuiConstants.au3>

GuiCreate("Test Read-Only Combo", 200, 200,(@DesktopWidth-200)/2, (@DesktopHeight-200)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Combo = GuiCtrlCreateCombo("Select Item", 20, 20, 160, 200, $CBS_DROPDOWNLIST )

$s_Combo = ""

For $i = 1 To 20

$s_Combo = $s_combo & "Item" & $i & "|"

Next

GUICtrlSetData($Combo, $s_Combo)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

  ExitLoop

Case Else

  ;;;

EndSelect

WEnd

Link to comment
Share on other sites

Here is the test code. Is there any mistakes?

<{POST_SNAPBACK}>

#include <GuiConstants.au3>

GuiCreate("Test Read-Only Combo", 200, 200,(@DesktopWidth-200)/2, (@DesktopHeight-200)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Combo = GuiCtrlCreateCombo("Select Item", 20, 20, 160, 50, $CBS_DROPDOWNLIST + $WS_VSCROLL )
$s_Combo = ""
For $i = 1 To 120
$s_Combo = $s_combo & "Item" & $i & "|"
Next
GUICtrlSetData($Combo, $s_Combo)

GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
  ExitLoop
Case Else
 ;;;
EndSelect
WEnd

Is this what u want?

HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

Thanks a lot - it does the trick. I just did not realized that window styles can be used with GUI controls.

<{POST_SNAPBACK}>

Like an addition...it's more appropriate to use the styles in this way:

BitOr( $CBS_DROPDOWNLIST, $WS_VSCROLL)

instead of

$CBS_DROPDOWNLIST + $WS_VSCROLL

:whistle:

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...