核心提示:uses commctrl;//display TabControl1 selected tabcaptions in an edit (Edit1) controlvarcnt: Integer;t...
uses commctrl;//display TabControl1 selected tab
captions in an edit (Edit1) control
var
cnt: Integer;
tabItem: TTCItem;
selTabs: string;
begin
selTabs := '';
for cnt := 0 to -1 + TabControl1.Tabs.Countdo
begin
FillChar(tabItem, SizeOf(tabItem), 0) ;
tabItem.mask := TCIF_STATE;
tabItem.dwStateMask := TCIS_BUTTONPRESSED;
if SendMessage(TabControl1.Handle, TCM_GETITEM, cnt, Longint(@tabItem)) <> 0 then
if (tabItem.dwState and TCIS_BUTTONPRESSED) <> 0 then
selTabs := selTabs + TabControl1.Tabs[cnt] + '|';
end;
Edit1.Text := '|' + selTabs;
end;