不管是复制粘贴
controlsettext
controlsend
_GUICtrlButton_SetText()
等命令都无法输入 是呀,与原始设计有关呀,如果原程序像你这么设计,永远也别想输入多余三个字符。是不是?
既然人家可以用其他方法输入字符,就说明人家有判断标准,能输入但是方法没找到。
下面这个代码,你用键盘输入将永远失败:#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 485, 90, -1, -1)
$Input1 = GUICtrlCreateInput("", 40, 32, 417, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_check",10)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _check()
If stringlen(GUICtrlRead($Input1))=1 Then
Global $T0=TimerInit ()
ElseIf stringlen(GUICtrlRead($Input1))=3 Then
Global $T1=TimerDiff($T0)
if $T1>30 Then
GUICtrlSetData($Input1,"")
EndIf
EndIf
EndFunc而用下面这段代码就可以输入:WinWaitActive("Form1")
ControlSetText("Form1","","Edit1","111111111111")下面这个类似于你的代码,是永远没法输入的:#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 485, 90, -1, -1)
$Input1 = GUICtrlCreateInput("", 40, 32, 417, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_check",10)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _check()
If stringlen(GUICtrlRead($Input1))=>3 Then
GUICtrlSetData($Input1,"")
EndIf
EndFunc 本帖最后由 顽固不化 于 2009-7-29 15:13 编辑
是呀,与原始设计有关呀,如果原程序像你这么设计,永远也别想输入多余三个字符。是不是?
既然人家可以用其他方法输入字符,就说明人家有判断标准,能输入但是方法没找到。
下面这个代码,你用键盘输入将永远失败:#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 485, 90, -1, -1)
$Input1 = GUICtrlCreateInput("", 40, 32, 417, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_check",10)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _check()
If stringlen(GUICtrlRead($Input1))=1 Then
Global $T0=TimerInit ()
ElseIf stringlen(GUICtrlRead($Input1))=3 Then
Global $T1=TimerDiff($T0)
if $T1>30 Then
GUICtrlSetData($Input1,"")
EndIf
EndIf
EndFunc而用下面这段代码就可以输入:WinWaitActive("Form1")
ControlSetText("Form1","","Edit1","111111111111")下面这个类似于你的代码,是永远没法输入的:#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 485, 90, -1, -1)
$Input1 = GUICtrlCreateInput("", 40, 32, 417, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
AdlibRegister("_check",10)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _check()
If stringlen(GUICtrlRead($Input1))>3 Then
GUICtrlSetData($Input1,"")
EndIf
EndFunc 我试了一下,你1楼的判断是=3,所以,用上面的第二段代码是可以输入多于3字符的。 很感谢大家积极帮我解决问题
尤其是顽固不化,既然你这样说
那就此结贴吧,再次感谢
页:
1
[2]