找回密码
 加入
搜索
查看: 3219|回复: 4

[GUI管理] ;GUICtrlCreateInput 怎么实现自动换行?

  [复制链接]
发表于 2012-3-26 14:11:19 | 显示全部楼层 |阅读模式
#include <GUIConstantsEx.au3>
#include <GuiComboBoxEx.au3>
#include <String.au3>
Example()

Func Example()
        Local $msg

        $hGUI=GUICreate("http://www.xfpm.org/")
                $tex2="浙江温州平阳旭峰塑料机械有限公司,专业生产:圆织机、小凸轮圆织机、四梭圆织机、网眼袋机、塑料收丝机、塑料扁丝、圆丝拉丝机、复合机、制袋机及相关塑料机械。"
                GUICtrlCreateLabel("网址:", 16, 60)
                $url = GUICtrlCreateInput("", 75, 55, 210, 20)
                $tPos = ControlGetPos($hGUI,"",$url)
                $input = GUICtrlCreateInput("", 75, $tpos[1]+$tpos[3]+5, 80, 20)
                $Button_1 = GUICtrlCreateButton("确定", 15, 260, 80)
        GUISetState()

        ; Run the GUI until the dialog is closed
        While 1
                $msg = GUIGetMsg()

   Select
                Case $msg = $GUI_EVENT_CLOSE
                        ExitLoop
                Case $msg=$Button_1
                                $x=StringLen(_StringToHex($tex2))
                                If $x*3.125>200 Then
                                        GUICtrlSetPos($input,16,$tpos[1]+$tpos[3]+30,260,$X*3.125/260*15)
                                        Else
                                        GUICtrlSetPos($input,75,$tpos[1]+$tpos[3]+10,80,14+$X*3.125/80*13)
                                        EndIf
                                                GUICtrlSetData($input,$tex2)
                               
        EndSelect
                WEnd
EndFunc   ;==>Example

以上代码主要是想通过对字符数量来确定输入框的大小与位置。

但是试了几个都是没办法自动换行。。。请高手指导。。
发表于 2012-3-26 14:32:05 | 显示全部楼层

#include <EditConstants.au3>

$input = GUICtrlCreateInput("", 75, $tpos[1]+$tpos[3]+5, 80, 20, $ES_MULTILINE)
;;; $ES_MULTILINE
;;; Designates a multiline edit control. The default is a single-line edit control.

评分

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

查看全部评分

 楼主| 发表于 2012-3-26 16:09:33 | 显示全部楼层
谢谢楼上。。。问题解决了。
但是通过GUICtrlSetStyle ( $input,$ES_MULTILINE)似乎没有反应。
发表于 2012-3-26 16:43:42 | 显示全部楼层
回复 3# forgetdu

需要bitor()
发表于 2012-3-26 17:01:38 | 显示全部楼层
学到了一招
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 23:05 , Processed in 0.074439 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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