找回密码
 加入
搜索
查看: 3818|回复: 8

[GUI管理] 谁告诉我那个GUI里面的状态栏是怎么用的【已解决】

  [复制链接]
发表于 2011-2-2 17:56:05 | 显示全部楼层 |阅读模式
本帖最后由 love5173 于 2011-4-12 00:04 编辑

当按下按钮1的时候,希望在界面上显示出来我黏贴板上的信息,请问使用什么函数,语法是怎样的
是StatusBar吗?绝对不能在GUI界面可以修改的重新点下按钮1的时候要吧原来的内容替换掉 用什么控件呢?函数我知道  状态栏能不能起这个作用?
发表于 2011-2-2 22:38:46 | 显示全部楼层
实在没看懂楼主的意思,正在看春晚,祝大家新年快乐!
 楼主| 发表于 2011-2-3 10:06:41 | 显示全部楼层
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=..\..\绑手机令牌辅助程序.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\MyDoc\Form1.kxf
$Form1 = GUICreate("辅助程序", 235, 438, 192, 114)
$Group1 = GUICtrlCreateGroup("VPN", 24, 32, 185, 89)
$Input1 = GUICtrlCreateInput("", 48, 64, 57, 37)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("变更", 128, 64, 57, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("序列号", 24, 184, 185, 113)
$Button2 = GUICtrlCreateButton("copy", 80, 216, 73, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1       
            RunWait(@ComSpec & " /c " & 'Rasphone -h 222.162.143.66')
                         $c=GUICtrlRead($Input1)
            RunWait(@ComSpec & " /c " & 'Rasdial 222.162.143.66 '& $c &'ip7 qazwsx')
                Case $Button2
            $bak = ClipGet()
                        RunWait(@ComSpec & " /c " & 'echo '& $bak &' >> D:\UserFile\Desktop\序列号.txt')
        EndSwitch
WEnd
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=..\..\绑手机令牌辅助程序.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\MyDoc\Form1.kxf
$Form1 = GUICreate("辅助程序", 235, 438, 192, 114)
$Group1 = GUICtrlCreateGroup("VPN", 24, 32, 185, 89)
$Input1 = GUICtrlCreateInput("", 48, 64, 57, 37)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("变更", 128, 64, 57, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("序列号", 24, 184, 185, 113)
$Button2 = GUICtrlCreateButton("copy", 80, 216, 73, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $Button1        
            RunWait(@ComSpec & " /c " & 'Rasphone -h 222.162.143.66')
                         $c=GUICtrlRead($Input1)
            RunWait(@ComSpec & " /c " & 'Rasdial 222.162.143.66 '& $c &'ip7 qazwsx')
                Case $Button2
            $bak = ClipGet()
                        RunWait(@ComSpec & " /c " & 'echo '& $bak &' >> D:\UserFile\Desktop\序列号.txt')
        EndSwitch
WEnd
 楼主| 发表于 2011-2-3 10:08:38 | 显示全部楼层
我的小软件代码在上面了,我就是想实现界面显示我刚才把什么东西复制到文本里去了,能不能在下面的状态栏显示,如果能要怎么写
如果不能用什么控件合适呢?
发表于 2011-2-3 11:18:19 | 显示全部楼层
本帖最后由 水木子 于 2011-2-3 11:32 编辑

是这个吗?
_GUICtrlStatusBar_SetText

#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 400, 300)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Dim $StatusBar1_PartsWidth[1] = [-1]
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar1, "", 0)
$Input1 = GUICtrlCreateInput("Input1", 50, 100, 200, 21)
$Button1 = GUICtrlCreateButton("Button1", 250, 98, 75, 25)
GUISetState()

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        Exit
                Case $Button1 
                        _GUICtrlStatusBar_SetText($StatusBar1, GUICtrlRead($Input1), 0)
        EndSwitch
WEnd
 楼主| 发表于 2011-2-3 11:39:57 | 显示全部楼层
水木子你太帅了,嘿嘿!
发表于 2011-2-3 11:50:46 | 显示全部楼层
呵呵!帅有个屁用,最后还是给卒吃掉。

评分

参与人数 1金钱 +60 收起 理由
ceoguang + 60 我很赞同

查看全部评分

发表于 2011-2-3 15:06:48 | 显示全部楼层
回复 7# 水木子

ntnnd也开始开玩笑了
发表于 2011-2-12 22:54:13 | 显示全部楼层
呵呵!帅有个屁用,最后还是给卒吃掉。
水木子 发表于 2011-2-3 11:50


呵呵,技术高的人怎么看都帅。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-25 17:21 , Processed in 0.088387 second(s), 27 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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