Jump to content

combo box text arrives "activated"


Rater
 Share

Recommended Posts

Cannot find any info on this: When my script creates a GUI with a combo box, the default text visible in the combo box arrives "activated" (i.e. highlighted blue).

I want to change this so that when the GUI arrives, the combo box text is NOT highlighted blue (or any other color).

Possible ???

:)

Link to comment
Share on other sites

Cannot find any info on this: When my script creates a GUI with a combo box, the default text visible in the combo box arrives "activated" (i.e. highlighted blue).

I want to change this so that when the GUI arrives, the combo box text is NOT highlighted blue (or any other color).

Possible ???

:)

Just move the focus to something else. Here is the example from help with a label added which is just to do what you want (I think).

#include <GUIConstants.au3>

GUICreate("My GUI combo"); will create a dialog box that when displayed is centered

GUICtrlCreateCombo ("item1", 10,10); create first item
GUICtrlSetData(-1,"item2|item3","item3"); add other item snd set a new default

$l = GUICtrlCreateLabel("",0,0,1,1)

GUISetState ()

GUICtrlSetState($l,$GUI_FOCUS);set focus to the 'invisible' label

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Just move the focus to something else. Here is the example from help with a label added which is just to do what you want (I think).

#include <GUIConstants.au3>

GUICreate("My GUI combo"); will create a dialog box that when displayed is centered

GUICtrlCreateCombo ("item1", 10,10); create first item
GUICtrlSetData(-1,"item2|item3","item3"); add other item snd set a new default

$l = GUICtrlCreateLabel("",0,0,1,1)

GUISetState ()

GUICtrlSetState($l,$GUI_FOCUS);set focus to the 'invisible' label

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Thank you, Martin. Very good idea.

:)

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