There is an Active Page property for Page Control, but that returns a handle for the active tab.
Is there a way to get the name of the tab?
<edit - code sample added>
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 424
Top = 301
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 261
ClientWidth = 255
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 120
TextHeight = 16
object PageControl1: TPageControl
Left = 30
Top = 21
Width = 200
Height = 193
ActivePage = Page2
TabOrder = 0
object Page1: TTabSheet
Caption = 'Page1'
ExplicitWidth = 281
end
object Page2: TTabSheet
Caption = 'Page2'
ExplicitWidth = 189
end
end
object Btn1: tMSButton
Left = 30
Top = 221
Width = 200
Height = 25
Caption = 'Show Current Page Name'
TabOrder = 1
DoBrowse = False
BrowseStyle = fbOpen
end
end
EndDialog>Dialog1
ADH>Dialog1,Btn1,OnClick,ShowPage
Show>Dialog1,r
SRT>ShowPage
GDP>Dialog1,PageControl1,ActivePage,CurrentPage
MDL>CurrentPage
END>ShowPage