找回密码
 加入
搜索
查看: 10709|回复: 12

[AU3基础] 请问edit文本框 里面的文字如何实现自动换行(已解决)

 火.. [复制链接]
发表于 2010-8-15 17:34:42 | 显示全部楼层 |阅读模式
本帖最后由 faceyao 于 2010-8-15 22:52 编辑

edit文本框控件 里面的文字内容如何实现自动换行,谢谢。

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-8-15 21:25:16 | 显示全部楼层
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
$Edit1 = GUICtrlCreateEdit("", 64, 24, 457, 225, BitOR($GUI_SS_DEFAULT_EDIT, $ES_READONLY))
$Input1 = GUICtrlCreateInput("请在此输入:", 64, 272, 457, 21)
$Button1 = GUICtrlCreateButton("Button1", 440, 344, 89, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        If GUICtrlRead($Input1) = "" Then
                                MsgBox(0, "", "空的?")
                        Else
                                GUICtrlSetData($Edit1, GUICtrlRead($Edit1) & GUICtrlRead($Input1) & @CRLF)
                                GUICtrlSetData($Input1, "")
                        EndIf
        EndSwitch
WEnd

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

 楼主| 发表于 2010-8-15 21:52:08 | 显示全部楼层
楼上的谢谢,辛苦了,不过似乎看不明白,有没有一句话解决的,自动换行一定非要写满26行代码吗
发表于 2010-8-15 21:58:07 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

GUICreate("My GUI edit")
$myedit = GUICtrlCreateEdit("后面的$WS_VSCROLL意思就是自动换行吧。" & @CRLF, 10, 10, 350, 350, $WS_VSCROLL)
GUISetState()
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-8-15 21:59:14 | 显示全部楼层
这26行里有20多行是自动生成的,主要就看
GUICtrlSetData($Edit1, GUICtrlRead($Edit1) & GUICtrlRead($Input1) & @CRLF)
这一行
发表于 2010-8-15 22:37:39 | 显示全部楼层
不懂,若能自动换行,水平滚动条岂不是多余的。。。。。。。。。
 楼主| 发表于 2010-8-15 22:52:25 | 显示全部楼层
回复 4# xsjtxy

谢谢4楼,这个可以换行成功!!!
发表于 2011-4-5 19:30:58 | 显示全部楼层
呵呵想法真不错
发表于 2014-4-26 13:13:20 | 显示全部楼层
呵呵想法真不错
发表于 2014-9-8 22:59:01 | 显示全部楼层
谢谢分享,正需要用到
发表于 2014-9-22 11:04:12 | 显示全部楼层
学习了,感谢,感谢,感谢了。非常感谢
发表于 2016-8-17 23:53:27 | 显示全部楼层
GUICtrlSetData($Edit1, GUICtrlRead($Input1) & @CRLF,1)

追加文本,且自动滚动
发表于 2016-10-3 00:13:46 | 显示全部楼层
感谢分享。。。。。谢谢。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-19 10:11 , Processed in 0.082201 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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