Jump to content
Sign in to follow this  

Limit GUICreateInput to Three Characters?

Recommended Posts


I have the following chunk of code:

$AdminIP = GUICtrlCreateLabel("Backup LAN IP", 5, 245, 175, 18)
    $Input_BackupIPOct1 = GUICtrlCreateInput("", 95, 245, 30, 18, $ES_NUMBER)
    $Dot1 = GUICtrlCreateLabel(".", 130, 245, 10, 18)
    $Input_BackupIPOct2 = GUICtrlCreateInput("", 135, 245, 30, 18, $ES_NUMBER)
    $Dot2 = GUICtrlCreateLabel(".", 170, 245, 10, 18)
    $Input_BackupIPOct3 = GUICtrlCreateInput("", 175, 245, 30, 18, $ES_NUMBER)
    $Dot3 = GUICtrlCreateLabel(".", 210, 245, 10, 18)
    $Input_BackupIPOct4 = GUICtrlCreateInput("", 215, 245, 30, 18, $ES_NUMBER)

It puts up four little boxes separated by three dots, each box for one octet of an IP address. I would like to make it do the following:

  • Limit the number of characters a user can enter to three characters.
  • Accept the "." character as equivalent to TAB to change fields.
Any suggestions here?



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.