Solved

TPanel.Canvas ?

Posted on 1998-12-23
5
234 Views
Last Modified: 2010-04-04
How Can i access to The TPanel.Canvas property ?

I am writing a annual calendar component. Each day is a TPanel. It works fine, but now i want to be abble to write :
1) In the Top Left Corner, in bold : the day number
2) In the Bottom right corner, in standard style : another number (User defined)

So, how could i do ?
The source code for the component is ready to use another object for the days. But this one have to publish all Drag events (used for multi-selection)
0
Comment
Question by:helpme020897
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 100 total points
ID: 1352702
You can't! What you can to it to create a TPanel decendant component that creates a TBitmap in it's constuctor and then put your controls on the bitmap..
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1352703
Hi helpme,

what about using TLables?

Make your own TPanel, inherit the TCustomPanel and overide the Paint method.

Regards, Zif.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1352704
Hi blackman. See that you were first :-)
0
 
LVL 1

Expert Comment

by:Smilly
ID: 1352705
Hi there,
You can get the canvas, on almost all control like this,
you have to make your own canvas....

procedure TForm1.Button1Click(Sender: TObject);
var DC: HDC;
    Canvas: TCanvas;
begin
     DC:=GetDC(panel1.handle);
     Canvas:=TCanvas.Create;
     Canvas.Handle := DC;
     Canvas.LineTo(100,100);
     Canvas.Free;
end;

Hope this will help you....
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1352706
Smilly u also should release the DC..

ReleaseDC(Panel1.Handle, DC);

Merry Christmas!

-Viktor
--Ivanov
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question