找回密码
 加入
搜索
查看: 2133|回复: 3

[GUI管理] 【已解决】为什么输入框设置$ES_PASSWORD之后,输入字符不能超过输入控件宽度范围

[复制链接]
发表于 2011-12-15 11:01:10 | 显示全部楼层 |阅读模式
本帖最后由 sanmoking 于 2011-12-15 11:06 编辑


#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("111", 200, 105, -1, -1);主窗口
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close");退出命令
$Label2 = GUICtrlCreateLabel("密码:", 10, 34, 40, 17)
;~ $Input2 = GUICtrlCreateInput("", 54, 32, 120, 21);不带密码样式,输入多少字都没问题。。。
$Input2 = GUICtrlCreateInput("", 54, 32, 120, 21, $ES_PASSWORD)
;~$Input2 = GUICtrlCreateInput("", 54, 32, 120, 21,$ES_PASSWORD+$ES_AUTOHSCROLL);这个就是答案
$ButtonInput1 = GUICtrlCreateButton("读取输入框", 60, 60, 80, 24);从ini配置文件中删除当前用户
GUICtrlSetOnEvent(-1, "ButtonInput1")
GUISetState(@SW_SHOW)
While 1;主循环
        Sleep(10);什么都不干
WEnd
Func Form1Close()
        Exit
EndFunc
Func ButtonInput1()
        MsgBox(0,"为什么?","字符数:"&StringLen(GUICtrlRead($Input2))&@CRLF&GUICtrlRead($Input2))
EndFunc
 楼主| 发表于 2011-12-15 11:05:40 | 显示全部楼层
知道了,密码样式不能单独用。。。。$ES_PASSWORD+$ES_AUTOHSCROLL得两个一起来。。。
发表于 2011-12-15 11:12:47 | 显示全部楼层
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("111", 200, 105, -1, -1);主窗口
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close");退出命令
$Label2 = GUICtrlCreateLabel("密码:", 10, 34, 40, 17)
;~ $Input2 = GUICtrlCreateInput("", 54, 32, 120, 21);不带密码样式,输入多少字都没问题。。。
$Input2 = GUICtrlCreateInput("", 54, 32, 120, 21, BitOR($ES_LEFT, $ES_AUTOHSCROLL ,$ES_PASSWORD))
$ButtonInput1 = GUICtrlCreateButton("读取输入框", 60, 60, 80, 24);从ini配置文件中删除当前用户
GUICtrlSetOnEvent(-1, "ButtonInput1")
GUISetState(@SW_SHOW)
While 1;主循环
        Sleep(10);什么都不干
WEnd
Func Form1Close()
        Exit
EndFunc
Func ButtonInput1()
        MsgBox(0,"为什么?","字符数:"&StringLen(GUICtrlRead($Input2))&@CRLF&GUICtrlRead($Input2))
EndFunc

评分

参与人数 1金钱 +22 收起 理由
sanmoking + 22 多谢。。。

查看全部评分

发表于 2011-12-15 14:27:19 | 显示全部楼层
学习了,多谢两位,我正纳闷呢,我原来那个输入框大小在XP下可以达到16位,在win7下却只能输11位了,现在问题也解决了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-1 05:40 , Processed in 0.088111 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表