Jump to content

About Progress


Chinasmoker
 Share

Recommended Posts

i wrote a script ,but Progress doesnt work,the follow is my script

CODE
#NoTrayIcon

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

Global $dir

#Region ### START Koda GUI section ### Form=E:\wk\au3\setup\Form1.kxf

$Form1 = GUICreate("pubwin自动安装程序", 335, 166, 193, 115)

GUISetOnEvent($GUI_EVENT_CLOSE,"close")

GUISetIcon(@ScriptDir &"\pubwin.ico")

$Pic1 = GUICtrlCreatePic(@ScriptDir &"\pubwin.jpg", 0, 0, 324, 60, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

$Group1 = GUICtrlCreateGroup("", 0, -8, 329, 73)

GUICtrlCreateGroup("", -99, -99, 1, 1)

$Label1 = GUICtrlCreateLabel("检测安装所需系统要求:", 8, 136, 136, 17)

$Button1 = GUICtrlCreateButton("开始安装", 256, 128, 75, 25, 0)

GUICtrlSetOnEvent($Button1,"setup")

$Label2 = GUICtrlCreateLabel("安装包路径:", 8, 88, 76, 17)

$Input1 = GUICtrlCreateInput("", 80, 80, 185, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))

$Button2 = GUICtrlCreateButton("浏览", 272, 80, 59, 25, 0)

GUICtrlSetOnEvent($Button2,"liu")

$progressbar1 = GUICtrlCreateProgress(144, 130, 100, 15)

GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")

GUICtrlSetColor(-1, 0xFF0000)

$Label4 = GUICtrlCreateLabel("注意:安装过程中请不要动键盘和鼠标", 8, 112, 208, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

sleep(1000)

WEnd

Func liu()

$dir = FileSelectFolder("adas","")

GUICtrlSetData($Input1,$dir)

EndFunc

Func setup()

;If $dir <> "" Then

For $i = 0 To 100

;MsgBox(0,"",$i)

GUICtrlSetData($progressbar1, $i)

Next

;EndIf

EndFunc

Func close()

Exit

EndFunc

One is never too old to learn

Link to comment
Share on other sites

The progressbar appears to work correctly when I run your script, though very fast. I'd suggest adding a short Sleep() entry inside the For... Next loop to see that it is, in fact, stepping through the percentages.

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...