I have 2 monitors.
Monitor 1 (1920x1200, lying) see http://img513.imageshack.us/img513/6762/monitor1k.jpg
Monitor 2 (1050x1680, stand, mirrored) see http://img851.imageshack.us/img851/8067/monitor2q.jpg
below is some testcode:
Code: Select all
//initial: get dialogs to center pos
GetScreenRes>leftresult,topresult
let>leftresult=leftresult/2
let>topresult=topresult/2
let>xdialogleft=600/2
let>ydialogheight=400/2
let>leftresult=leftresult-xdialogleft
let>topresult=topresult-ydialogheight
Let>leftresult={Round(%leftresult%)}
Let>topresult={Round(%topresult%)}
Dialog>Dialog1
object Dialog1: TForm
Left = 1
Top = 1
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Main Dialog'
ClientHeight = 400
ClientWidth = 600
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 108
TextHeight = 13
object MSButton1: tMSButton
Left = 518
Top = 366
Width = 75
Height = 25
Caption = 'Exit'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton2: tMSButton
Left = 438
Top = 366
Width = 75
Height = 25
Caption = 'Open next'
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Left = 1
Top = 1
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Sub dialog'
ClientHeight = 260
ClientWidth = 460
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 108
TextHeight = 13
object MSButton1a: tMSButton
Left = 376
Top = 230
Width = 75
Height = 25
Caption = 'Exit'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog2
SetDialogProperty>Dialog1,,Left,%leftresult%
SetDialogProperty>Dialog1,,Top,%topresult%
AddDialogHandler>Dialog1,MSButton1,OnClick,Doclose
AddDialogHandler>Dialog1,MSButton2,OnClick,DoOpen2
Show>Dialog1,r
SRT>Doclose
exit
END>Doclose
SRT>Doclose2
CloseDialog>Dialog2
END>Doclose2
SRT>DoOpen2
GetDialogProperty>Dialog1,,Top,%topresult%
GetDialogProperty>Dialog1,,Left,%leftresult%
SetDialogProperty>Dialog2,,Top,%topresult%
SetDialogProperty>Dialog2,,Left,%leftresult%
AddDialogHandler>Dialog2,MSButton1a,OnClick,Doclose2
Show>Dialog2,r
END>DoOpen2
But when i drag 'Main Dialog' "into" Monitor2 and then press "Open next", the 'Sub dialog' will open in Monitor1.
What am i doing wrong? Has anyone a solution for this?
Thanks in advance and best regards,
wil