Jump to content

Combo Box with no Edit


midiaxe
 Share

Recommended Posts

Hello everybody,

I have a GUI and I need to create a combo box with the edit disable. I looked at the GUI doc and did not find any style definition for this. Am I missing something?

Appreciate the help!

Thanks,

=MX=

Edited by midiaxe
Link to comment
Share on other sites

I tried the following code below and it seems that the listbox is still editable. I'm using the latest unstable version:

Thanks!

#include <GUIConstants.au3>

$wndMain = GUICreate("My GUI")

$cboBuildFile = GUICtrlCreateCombo("item1", 10, 10, 200, $CBS_DROPDOWNLIST)
GUICtrlSetData($cboBuildFile,"item2|item3","item3") 
GuiSetState(@SW_SHOW)

;-------------------------------
; Just idle around
While 1
  $msg = GUIGetMsg()
  If $msg = $GUI_EVENT_CLOSE Then   ExitLoop
Wend
Link to comment
Share on other sites

Or 'Read-Only' you said?

Here a small example:

Global $CBS_DROPDOWNLIST= 3
Global $ES_READONLY= 2048
Global $LBS_STANDARD= 10485763
$GUI_EVENT_CLOSE= -3

GUICreate("test", 200, 100)

$combo=GUICtrlCreateCombo("", 10, 10, 100, 80, BitOR($ES_READONLY, $CBS_DROPDOWNLIST, $LBS_STANDARD))
GUICtrlSetData($combo,"item1|item2|item3", "item1")
GUISetState()

While 1
   $msg= GUIGetMsg()
  
   If $msg = $GUI_EVENT_CLOSE Then Exit
  
Wend
Exit
Link to comment
Share on other sites

Blame my fat finger I guess :) . Thanks Valik for spotting that error. Josbe, thanks for code, it really helped me. I've been debugging my code since last night and can't figure it out until I saw your code. I didnt know that you can use some style definitions from a control to another control (in this case an edit style, to a combo style).

Thanks,

-MX-

Edited by midiaxe
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...