Sign in to follow this  
Followers 0
is8591

need help with combo

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



Does this mean that it's impossible to have a read-only combo with a scrollable list?

Share this post


Link to post
Share on other sites

Seems like you have a problem with scrolling, and I'm not talking about the combo.

Set the height of the combobox to be around 100px.

<{POST_SNAPBACK}>

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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:

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  
Followers 0