BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem in implementing a Transparent TMonthCalendar

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing
View previous topic :: View next topic  
Author Message
Atul
Guest





PostPosted: Tue Jan 10, 2006 4:27 am    Post subject: Problem in implementing a Transparent TMonthCalendar Reply with quote



Hi All,

I am trying to implement a Transparent TMonthCalendar, but not able to
get it done proper.

Scenario:

I am using an MDI Form application. On the form i have an image control
with .jpg image. On the image i have to place TMonthCalendar which
should be transparant. The TMonthCalendar should be transparent in such
a way that on the image only days/month/year should appear...as if it
was watermarked on the image.

I am trying to achieve that as follows but not able to get what i have
described in the above scenario.

I thought this way it would work but i am getting the Forms colour when
my calendar control is getting transparent.

---------------------------------------------------------------------------------------------------------------------------------------

Following is my code:

unit MYMonthCalendar;

interface

uses
Windows, Messages, SysUtils, Classes, Controls, ComCtrls,forms;

type
TMYMonthCalendar = class(TMonthCalendar)
private
function GetTransparent: Boolean;
procedure SetTransparent(const Value: Boolean);
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
property Transparent: Boolean read GetTransparent write
SetTransparent default False;
end;

procedure Register;

implementation

procedure Register;
begin
RegisterComponents('Samples', [TMYMonthCalendar]);
end;

{ TMYMonthCalendar }

function TMYMonthCalendar.GetTransparent: Boolean;
begin
Result := not (csOpaque in ControlStyle);
end;

procedure TMYMonthCalendar.SetTransparent(const Value: Boolean);
begin
if Transparent <> Value then
begin
if Value then
CalColors.TitleBackColor := TForm(Self.Parent).Color;
CalColors.MonthBackColor := TForm(Self.Parent).Color;
Invalidate;
end;
end;

end.

---------------------------------------------------------------------------------------------------------------------------------------

waiting for your reply soon as earliest possible. your help is
appreciated.

thanks in advance,
regards,
Atul

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Writing All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.