It seems to extend to other events too, because the Checkbox with the event didn't work after 21 times of dialog-changing.
What is the problem?
Code below, if you want to try it.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 531
Top = 197
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Dialog 1'
ClientHeight = 153
ClientWidth = 169
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 Label1: TLabel
Left = 48
Top = 112
Width = 76
Height = 13
Caption = 'Times Shifted: 0'
end
object MSButton1: tMSButton
Left = 35
Top = 28
Width = 102
Height = 25
Caption = 'Go To Dialog 2'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton2: tMSButton
Left = 35
Top = 72
Width = 102
Height = 25
Caption = 'Refresh Dialog 1'
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
object CheckBox1: TCheckBox
Left = 34
Top = 141
Width = 97
Height = 17
Caption = 'CheckBox1'
TabOrder = 10
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Left = 531
Top = 197
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'Dialog 2'
ClientHeight = 88
ClientWidth = 161
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 Label1: TLabel
Left = 40
Top = 64
Width = 76
Height = 13
Caption = 'Times Shifted: 0'
end
object MSButton1: tMSButton
Left = 28
Top = 22
Width = 109
Height = 25
Caption = 'Go to Dialog 1'
TabOrder = 0
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog2
Let>WinShift=0
AddDialogHandler>Dialog1,MSButton1,OnClick,fromDialog1ToDialog2
AddDialogHandler>Dialog1,MSButton2,OnClick,fromDialog1ToDialog1
AddDialogHandler>Dialog1,CheckBox1,OnClick,MessageModalOpen
AddDialogHandler>Dialog2,MSButton1,OnClick,fromDialog2ToDialog1
Show>Dialog2,
SRT>fromDialog1ToDialog1
CloseDialog>Dialog1
Add>WinShift,1
Let>Message=Times Shifted: %WinShift%
SetDialogProperty>Dialog1,Label1,Caption,Message
Show>Dialog1,
END>fromDialog1ToDialog1
SRT>MessageModalOpen
MessageModal>Checked!
END>MessageModalOpen
SRT>fromDialog1ToDialog2
CloseDialog>Dialog1
Add>WinShift,1
Let>Message=Times Shifted: %WinShift%
SetDialogProperty>Dialog2,Label1,Caption,Message
Show>Dialog2,
END>fromDialog1ToDialog2
SRT>fromDialog2ToDialog1
CloseDialog>Dialog2
Add>WinShift,1
Let>Message=Times Shifted: %WinShift%
SetDialogProperty>Dialog1,Label1,Caption,Message
Show>Dialog1,
END>fromDialog2ToDialog1