But when you switch, that tab should have the focus.
Instead the focus switches to the permanent tab.
To repro:
Run this
Select Button 1, 2 or 3
Keep selecting different buttons
Note focus does not go to the tab 'selected' even with SetDialogObjectFocus
Any suggestions?
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 1992
Top = 104
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 299
ClientWidth = 431
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 PageControl1: TPageControl
Left = 29
Top = 78
Width = 372
Height = 187
ActivePage = Page3
TabOrder = 0
object AlwaysShows: TTabSheet
Caption = 'Always Shows'
ExplicitTop = 56
end
object Page1: TTabSheet
Caption = 'Page1'
end
object Page2: TTabSheet
Caption = 'Page2'
end
object Page3: TTabSheet
Caption = 'Page3'
end
end
object MSButton1: tMSButton
Left = 28
Top = 20
Width = 75
Height = 25
Caption = '1'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton2: tMSButton
Left = 132
Top = 20
Width = 75
Height = 25
Caption = '2'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 2
DoBrowse = False
BrowseStyle = fbOpen
end
object MSButton3: tMSButton
Left = 237
Top = 20
Width = 75
Height = 25
Caption = '3'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 3
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
ADH>Dialog1,MSButton1,OnClick,ButtonClick1
ADH>Dialog1,MSButton2,OnClick,ButtonClick2
ADH>Dialog1,MSButton3,OnClick,ButtonClick3
Show>Dialog1,r
SRT>ButtonClick1
SDP>Dialog1,Page1,TabVisible,True
SDP>Dialog1,Page2,TabVisible,False
SDP>Dialog1,Page3,TabVisible,False
SetDialogObjectFocus>Dialog1,Page1
END>ButtonClick1
SRT>ButtonClick2
SDP>Dialog1,Page1,TabVisible,False
SDP>Dialog1,Page2,TabVisible,True
SDP>Dialog1,Page3,TabVisible,False
SetDialogObjectFocus>Dialog1,Page2
END>ButtonClick2
SRT>ButtonClick3
SDP>Dialog1,Page1,TabVisible,False
SDP>Dialog1,Page2,TabVisible,False
SDP>Dialog1,Page3,TabVisible,True
SetDialogObjectFocus>Dialog1,Page3
END>ButtonClick3