Hello All,
How to create 2 or three dialogs and show them all on screen?
I would like to create two of them and show each of them on my two screens. (one screen one dialog)
Thanks
Create and show multiple dialogs
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Create and show multiple dialogs
Just give each a unique name :
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 1073
Top = 214
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label1'
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Left = 1073
Top = 214
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label2'
end
end
EndDialog>Dialog2
Dialog>Dialog3
object Dialog3: TForm
Left = 1073
Top = 214
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label3'
end
end
EndDialog>Dialog3
show>dialog1
show>dialog2
show>dialog3
label>loop
wait>0.5
goto>loop
Yes, we have a Custom Scripting Service. Message me or go here
Re: Create and show multiple dialogs
Thanks a lot Dorian.
Re: Create and show multiple dialogs
And I am not able to set the dialog3 position to the second screen.
I am using these:
I am using these:
Code: Select all
SetDialogProperty>Dialog1,,Left,0
SetDialogProperty>Dialog1,,Top,10
SetDialogProperty>Dialog2,,Left,800
SetDialogProperty>Dialog2,,Top,10
SetDialogProperty>Dialog3,,Left,1920
SetDialogProperty>Dialog3,,Top,10
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Create and show multiple dialogs
Are you using SetDialogProperty before or after Show? Use it after :
Also ensure your screen coordinates are correct - I always restart Macro Scheduler after connecting my 2nd screen.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 500
Top = 1000
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label1'
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Left = 500
Top = 2000
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label2'
end
end
EndDialog>Dialog2
Dialog>Dialog3
object Dialog3: TForm
Left = 500
Top = 3000
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label3'
end
end
EndDialog>Dialog3
show>Dialog1
show>Dialog2
show>Dialog3
SetDialogProperty>Dialog1,,Left,0
SetDialogProperty>Dialog1,,Top,10
SetDialogProperty>Dialog2,,Left,800
SetDialogProperty>Dialog2,,Top,10
SetDialogProperty>Dialog3,,Left,1920
SetDialogProperty>Dialog3,,Top,10
label>loop
wait>0.5
goto>loop
Yes, we have a Custom Scripting Service. Message me or go here
Re: Create and show multiple dialogs
Thanks. It worked now.
Re: Create and show multiple dialogs
Glad the previous code sample is working for you.
For a different perspective.
Because I usually use modal dialogs I use the MoveWindow> function to preset dialog positions. Don't need a loop after the dialog calls.
Changed the x position for Dialog3 as I only have one monitor.
For a different perspective.
Because I usually use modal dialogs I use the MoveWindow> function to preset dialog positions. Don't need a loop after the dialog calls.
Changed the x position for Dialog3 as I only have one monitor.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 500
Top = 1000
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label1'
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Left = 500
Top = 2000
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label2'
end
end
EndDialog>Dialog2
Dialog>Dialog3
object Dialog3: TForm
Left = 500
Top = 3000
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 162
ClientWidth = 1170
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -28
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 240
TextHeight = 32
object Label1: TLabel
Left = 392
Top = 40
Width = 164
Height = 64
Caption = 'Label3'
end
end
EndDialog>Dialog3
Let>Win_UseHandle=1
MoveWindow>Dialog1.handle,0,10
MoveWindow>Dialog2.handle,800,10
MoveWindow>Dialog3.handle,1720,10
Let>Win_UseHandle=0
show>Dialog1
show>Dialog2
show>Dialog3,