Jump to content
Sign in to follow this  
MrPook

GUICtrlCreateCombo : how to limit the set of characters used ?

Recommended Posts

MrPook

Hello,

For this last year, i've got a noob question.

Not very familiar with GUICtrlCreateCombo in fact.

I want to make a combo that :

- only accepts alpha characters (no spaces, "!", "é" , ...) : to rephrase it, i wish i could set the choice of characters to use (as in wind*ws for the folders : "no / allowed")

- or : is only readable : i may set a set of choices A|B|C and the user cannot input D

thanks in advance.

Pook

Share this post


Link to post
Share on other sites
martin

Hello,

For this last year, i've got a noob question.

Not very familiar with GUICtrlCreateCombo in fact.

I want to make a combo that :

- only accepts alpha characters (no spaces, "!", "é" , ...) : to rephrase it, i wish i could set the choice of characters to use (as in wind*ws for the folders : "no / allowed")

- or : is only readable : i may set a set of choices A|B|C and the user cannot input D

thanks in advance.

Pook

There might be some way I don't know of, but I would detect the CBN_EDITUPDATE notification, then if the edit control of the combo has a character that is not allowed remove it. If you search for CBN_EDITUPDATE you might find examples to help.


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.

Share this post


Link to post
Share on other sites
star2

#include <GUIConstants.au3>
GUICreate("My GUI combo")
$com = GUICtrlCreateCombo ("Testing", 10,10)
GUICtrlSetData(-1,"Text with spaces|Text with spaces and number 2008|special char ® ë ©")
$test = GUICtrlCreateButton ("Test Combo-item", 10,50,150,25)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $test Then
    $read = GUICtrlRead ($com)
    If StringIsAlpha ($read) = 0 or StringIsASCII($read) = 0 Then
        MsgBox (-1, "info", "No Spaces or ASCII allowed")
    Else
        MsgBox (-1, "info", "You're Text Is OK")
    EndIf
    EndIf
Wend


[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.