1. Computing & Technology

Discuss in my forum

TPageControl TIPS :: TPageControl is a set of pages used to make a multiple page dialog box. Why not enable your users to rearrange tabs in a TPageControl component at run-time using drag and drop...
Drop a TPageControl on a form, add several (tab) pages and handle the MouseDown, DragDrop and DragOver events of the TPageControl (PageControl1) component ...

Read the full article to learn how to Move TPageControl's Tabs Using Drag and Drop

Related:

Comments
May 14, 2009 at 4:50 am
(1) Ken Knopfli :

I’d love to know how, in the very similar TTabControl, you can find out programmatically which buttons are in the down position when Multiselect is enabled.

How’s THAT for a programmer challenge! :)

May 14, 2009 at 6:50 am
(2) Zarko Gajic :

Ken:

1) Have a TTabControl named “tc”
2) Add “commctrl” to the uses clause

Here’s the function

var
cnt: Integer;
tabItem: TTCItem;
selTabs: string;
begin
selTabs := ”;
for cnt := 0 to tc.Tabs.Count – 1 do
begin
FillChar(tabItem, SizeOf(tabItem), 0);
tabItem.mask := TCIF_STATE;
tabItem.dwStateMask := TCIS_BUTTONPRESSED;
if SendMessage(tc.Handle, TCM_GETITEM, cnt, Longint(@tabItem)) <> 0 then
if (tabItem.dwState and TCIS_BUTTONPRESSED) <> 0 then
selTabs := selTabs + tc.Tabs[cnt] + ‘|’;
end;

ShowMessage(’|’ + selTabs);
end;

Anyway:
http://delphi.about.com/u/ua/delphichallengesexercises/pimp-my-delphi-code-challenges.htm

May 15, 2009 at 6:19 am
(3) Ken Knopfli :

Good grief!

Well, first of all, thank you very much!

But on the other hand, having to go back to first principles like this in order to use something the control already exposes as a property is a good example of the reasons I hesitate to recommend Delphi to my boss.

Spending this amount of time to discover a trick that really should have been there already may have been a way to show off 10 years ago, but it is not acceptable nowadays.

May 15, 2009 at 6:33 am
(4) Zarko Gajic :

@Ken:

Hm .. what to say. I could dig dozens of examples where you need to go down to API in order to have something one expects to be exposed as a property.

ListView OnItemChecked for example.

Maybe TTabControl control is not the correct one for what you are using it?

Something like the above should not be a stopper for you and your boss. I could give you a very large list of “missing” properties in .NET (Windows Forms controls) and in some other languages…

May 15, 2009 at 10:22 am
(5) Ken Knopfli :

Visual Studio and C# has things that really make a big difference. Like proper Help, intellisense that tells you more, and the ability to add intellisense comments to your own functions.

But the biggest difficulty is the poor Help in Delphi.

To me and my own Win32 work, your website is very valuable. Thank you again. But I use VS C# at work and it’s impossible to expect other people to use Delphi after having used VS.

Hey, perhaps your website could be reformated into a help and integrated into Delphi?!? :)

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved.

A part of The New York Times Company.