Jump to content

Tormund

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Tormund

  1. Thank you guys, I just found a way to achieve what I was looking for. I´ll post the code here for future reference. By the way, I just modified the code for my needs. The original post came from this thread (http://forum.autoitbrasil.com) Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) Local $iCode = BitShift($wParam, 16) Local $iIDFrom = _WinAPI_LoWord($wParam) Switch $iIDFrom Case $tbMyInputNumber Switch $iCode Case $EN_UPDATE Local $sWMCOMMAND_MyInputNumberRead = GUICtrlRead($tbMyInputNumber) Local $sWMCOMMAND_MyInputNumberLastChar = StringRight($sWMCOMMAND_MyInputNumberRead, 1) Local $aWMCOMMAND_MyInputNumberDotSplit = StringSplit($sWMCOMMAND_MyInputNumberRead, "/") If StringLen($sWMCOMMAND_MyInputNumberRead) = 7 Then GUICtrlSetData($tbMyInputNumber, $sWMCOMMAND_MyInputNumberRead & "-") ElseIf StringLen($sWMCOMMAND_MyInputNumberRead) = 10 Then GUICtrlSetData($tbMyInputNumber, $sWMCOMMAND_MyInputNumberRead & ".") ElseIf StringLen($sWMCOMMAND_MyInputNumberRead) = 15 Then GUICtrlSetData($tbMyInputNumber, $sWMCOMMAND_MyInputNumberRead & ".") ElseIf StringLen($sWMCOMMAND_MyInputNumberRead) = 17 Then GUICtrlSetData($tbMyInputNumber, $sWMCOMMAND_MyInputNumberRead & ".") ElseIf StringLen($sWMCOMMAND_MyInputNumberRead) = 20 Then GUICtrlSetData($tbMyInputNumber, $sWMCOMMAND_MyInputNumberRead & ".") ElseIf StringLen($sWMCOMMAND_MyInputNumberRead) = 25 Then GUICtrlSetData($tbMyInputNumber, $sWMCOMMAND_MyInputNumberRead) EndIf Case Else EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND
  2. Hello Guys, I´ve a very similar situation here. There is one inputbox in my GUI which I should receive a Product-ID and I would like to use this very good solution provided by @mikell to avoid problems of mistyping. My project ID is like this example: 1234567-89.2016.8.19.0001 The biggest problem with my Product-ID is related to the existence of two different types of separators such as "-" and " . " and because of this I´ve no idea to solve this using Regex.... maybe the best approach is StringReplace but once that I my ID is so big, StringReplace is killing me. So I was wondering if someone here could help me to achieve this goal... Cheers
×
×
  • Create New...