找回密码
 加入
搜索
查看: 2992|回复: 5

[AU3基础] 请教如何让GUICtrlCreateEdit编辑框填充内容右侧滚动条自动下移?

  [复制链接]
发表于 2014-3-25 00:47:40 | 显示全部楼层 |阅读模式
本帖最后由 smooth 于 2014-3-25 00:49 编辑

在默认的情况下,往GUICtrlCreateEdit动态的填充内容时,右侧的滚动条会往上走,强行用鼠标按住下拉都拉不动它,有没有办法让它往下走?这样的目的是可以看到最新的填充内容。或者让它别自己动,让用户自己去拖动滚动条来查看编辑框中的内容。谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2014-3-25 11:22:34 | 显示全部楼层
2# 禁言一周,下次永久禁言。
发表于 2014-3-25 14:17:32 | 显示全部楼层
回复 1# smooth


    如下代码: (主要是函数 _GUICtrlEdit_AppendText 的应用)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiEdit.au3>
Opt("GUIOnEventMode", 1)
Global $start=False
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Edit显示例子", 365, 532, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Edit1 = GUICtrlCreateEdit("", 8, 8, 353, 409)
$Button1 = GUICtrlCreateButton("Start", 96, 448, 153, 49)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        Sleep(500)
        If $start Then _GUICtrlEdit_AppendText($Edit1,"my test text"&Random()&@CRLF)
WEnd

Func Button1Click()
        $start=Not $start
        If $start Then
                GUICtrlSetData($Button1,"Stop")
        Else
                GUICtrlSetData($Button1,"Start")
        EndIf
EndFunc

Func Form1Close()
        Exit
EndFunc

 楼主| 发表于 2014-3-25 14:40:11 | 显示全部楼层
回复 4# lanfengc

兄弟,谢谢!要的就是这样的效果。我再仔细研究研究,不懂再请教你,希望你别嫌我烦。^^
发表于 2014-3-27 11:43:19 | 显示全部楼层
回复 4# lanfengc
谢谢,学习了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-3 06:32 , Processed in 0.090547 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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