Print Page | Close Window

TAdvPageControl

Printed From: TMS Software
Category: VCL Components
Forum Name: VCL General
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=14227
Printed Date: 29 Feb 2020 at 10:02am


Topic: TAdvPageControl
Posted By: Balslev Anders
Subject: TAdvPageControl
Date Posted: 16 Nov 2019 at 5:48pm
On the TAdvPageControl, there is an event called "OnDrawTab", most likely for the intention of making a custom drawing of the tabs.
Are there any property that must be set to true (or false) in order to bring this eventhandler to be fired?

br.

Anders



Replies:
Posted By: Bruno Fierens
Date Posted: 17 Nov 2019 at 10:07am
Yes, it is to perform custom drawing.
I have tested this here with a default TAdvPageControl on the form and assigning the OnDrawTab event here and I see this is being called.
Do you use the latest version and/or what are you doing different?


Posted By: Balslev Anders
Date Posted: 05 Dec 2019 at 12:08pm
Hi Bruno
Sorry for the late reply
My version is:
2.0.1.7

by debugging, I can see that the "OnDrawTab" event is not fired.
br.
Anders


Posted By: Bruno Fierens
Date Posted: 05 Dec 2019 at 12:09pm
The latest version is v2.0.2.2 and with this version,I cannot reproduce an issue with OnDrawTab


Posted By: Balslev Anders
Date Posted: 05 Dec 2019 at 12:32pm
Hi again Bruno

Just downloaded apparently most recent.

After installing (Delphi Rio SP2), the new version was:
2.0.2.0 (not 2.0.2.2)

And apparently the problem still persists.
br.

Anders


Posted By: Bruno Fierens
Date Posted: 05 Dec 2019 at 2:47pm
The latest version is in TMS VCL UI Pack v10.1.1.0 and is v2.0.2.2
If a problem persists with this latest version v2.0.2.2, please provide a sample source project + detailed steps to allow us to reproduce this here.


Posted By: Balslev Anders
Date Posted: 05 Dec 2019 at 3:17pm
I have downloaded from
TMS Component pack
- not from TMS VCL UI Pack

Maybe it's the problem (?)
I do have a sample program, which I woukd like to send to you (can it be by e-mail?)

The steps:
Drop a TAdvPageControl on the form
Create 2 tabsheets
Define TabBorder3D property to True
Define the "OnDrawTab" event as follows:

procedure TForm1.AdvPageControl1DrawTab(Control: TCustomTabControl;
  TabIndex: Integer; const Rect: TRect; Active: Boolean);
begin
  case TabIndex of
  0:
    begin
      Control.Canvas.Brush.Color:=clGreen;
    end;
  1:
    begin
      Control.Canvas.Brush.Color:=clBlue;
    end;
  else
    Control.Canvas.Brush.Color:=clRed;
  end;
end;

I would expect that the tabs would be colored






Posted By: Bruno Fierens
Date Posted: 05 Dec 2019 at 3:18pm
The latest versions of the components are in TMS VCL UI Pack
https://www.tmssoftware.com/site/blog.asp?post=570 - https://www.tmssoftware.com/site/blog.asp?post=570


Posted By: Balslev Anders
Date Posted: 05 Dec 2019 at 3:51pm
Hi again.

Now the version is 2.0.2.2

But still - I can't bring it to work.

Send please an email where I can send a small demo project (it only fill 6 KB)
Br.

Anders


Posted By: Bruno Fierens
Date Posted: 05 Dec 2019 at 3:53pm
https://www.tmssoftware.com/site/support_mail.asp - https://www.tmssoftware.com/site/support_mail.asp



Print Page | Close Window