Jump to content

Label inside of a combo box?


BeBoP
 Share

Recommended Posts

  • Moderators

BeBoP,

You will have to do it in code like this: ;)

#include <GUIConstantsEx.au3>
#include <GuiComboBox.au3>

$hGUI = GUICreate("Test", 500, 500)

$hCombo = GUICtrlCreateCombo("", 10, 10, 200, 20)
GUICtrlSetData(-1, "1|2|3|------|4|5|6")

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $hCombo
            ; Look for the separator
            If GUICtrlRead($hCombo) = "------" Then
                ; And remove it
                _GUICtrlComboBox_SetEditText($hCombo, "")
            EndIf
            ; Prove there is nothing to read
            ConsoleWrite(GUICtrlRead($hCombo) & @CRLF)
    EndSwitch
WEnd

All clear? :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 7 months later...

After a web search, I found this post and found it interesting but not as a true separator line!

I know it can be done using OwnerDraw / MeasureItem that are also used in ModernMenu, I tried to adapt the code but is giving many errors ...

I do not know much about combobox and if anyone can give would help a great value!

I found this link ComboBox OwnerDraw in 5 minutes who talks a lot but could not adapt!

Sample:

Posted Image

Regards,

João Carlos.

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

After a brief study and support of members of AutoItBrasil, we come to the following examples:

Download:

ComboBox_LineSeparator_Beta.zip

New updates:

ComboBox_LineSeparator_Beta.zip

Credits:

Medabi

V!c†o®

joelson0007

Belini

JScript

Anyone wishing to make an improvement, feel free!

Regards,

João Carlos.

Edited by JScript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

  • Moderators

JScript & friends,

Very nice! :thumbsup:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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