Jump to content

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?

Thanks,

-Chris

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