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

[GUI管理] 怎么弄滚动字体(已解决)

  [复制链接]
发表于 2010-12-1 22:14:29 | 显示全部楼层 |阅读模式
本帖最后由 18997 于 2013-7-18 22:43 编辑
让字体在窗体内滚动起来要怎么弄呢?

解决方法
用GUICtrlSetPos配合数学函数
在楼下几楼
发表于 2010-12-1 22:17:09 | 显示全部楼层
本帖最后由 tryhi 于 2012-7-9 01:13 编辑

横向滚动
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 300, 192, 124)
$Label1 = GUICtrlCreateLabel("横向滚动", 0, 100, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        For $i = 1 To 500
                GUICtrlSetPos($Label1, $i, 100)
                Sleep(10)
        Next
        Sleep(100)
WEnd



波浪形滚动
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 300, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 0, 100, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        For $x = 1 To 500
                $y = 30 * Sin(0.05 * $x)
                GUICtrlSetPos($Label1, $x, 100 + $y)
                Sleep(10)
        Next
        Sleep(10)
WEnd



圆形滚动
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 500, 300, 192, 124)
$Label1 = GUICtrlCreateLabel("Label1", 0, 100, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        For $x = -100 To 100
                $y = Sqrt(100 ^ 2 - $x ^ 2)
                GUICtrlSetPos($Label1, $x + 100, 100 + $y)
                Sleep(10)
        Next
                For $x = 100 To -100 Step -1
                $y = Sqrt(100 ^ 2 - $x ^ 2)
                GUICtrlSetPos($Label1, $x + 100, 100 - $y)
                Sleep(10)
        Next
        Sleep(10)
WEnd

评分

参与人数 1贡献 +2 收起 理由
afan + 2

查看全部评分

发表于 2010-12-2 16:31:30 | 显示全部楼层
收藏学习...
发表于 2010-12-18 13:36:21 | 显示全部楼层
太威了啦!!tryhi大大..還有波浪型滾動的........
发表于 2012-5-23 17:49:27 | 显示全部楼层
在关闭窗口的时候,响应慢了点
发表于 2012-5-23 19:03:56 | 显示全部楼层
不错不错,收藏备用...
发表于 2012-5-23 19:08:35 | 显示全部楼层
问一下,从右往左滚动咋整的???
发表于 2012-8-31 22:53:34 | 显示全部楼层
在关闭窗口的时候,响应慢了点
发表于 2017-6-13 17:10:51 | 显示全部楼层
这方法问题多多
发表于 2017-7-2 00:12:08 | 显示全部楼层
有人能写个更完美的吗?期待高手写个更完美的
发表于 2017-12-23 18:01:14 | 显示全部楼层
不错,谢谢提供
发表于 2019-6-27 10:22:52 | 显示全部楼层
还是用图像比较好
发表于 2019-6-27 13:59:07 | 显示全部楼层
有意思,学习了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 06:23 , Processed in 0.084172 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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