Good day all. I figured out the progress bar, very good indeed!!!
Overall, the updates in 12 for the dialog box creation is 100x's better. Well worth it alone for the upgrade.
But I do have a question in regards to the progress bar. Is there any way to create a dialog box with a progress bar, that stays open, but has a cancel button. I can see if I don't try to get a result from a dialog, the script happily continues on, but how can I capture that Cancel button later in the script to stop the script from running?
Frank
Progress Bar Question
Moderators: JRL, Dorian (MJT support)
I think you're looking for the AddDialogHandler> function.
Following is a non modal dialog with a progress bar
Following is a non modal dialog with a progress bar
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 339
Top = 149
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 223
ClientWidth = 439
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object MSButton1: tMSButton
Left = 181
Top = 103
Width = 75
Height = 25
Caption = 'Cancel'
DoubleBuffered = True
ModalResult = 2
ParentDoubleBuffered = False
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
object ProgressBar1: TProgressBar
Left = 22
Top = 20
Width = 395
Height = 16
MarqueeInterval = 5
Step = 5
TabOrder = 9
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,msButton1,OnClick,Quit
Show>dialog1
Let>kk=0
Label>Loop
Wait>0.05
If>kk=100
Let>value=-1
EndIf
If>kk=0
Let>value=1
EndIf
Add>kk,%value%
SetDialogProperty>Dialog1,ProgressBar1,Position,%kk%
Goto>Loop
SRT>Quit
Exit>0
END>Quit
- Phil Pendlebury
- Automation Wizard
- Posts: 543
- Joined: Tue Jan 16, 2007 9:00 am
- Contact:
Phil Pendlebury - Linktree