Solved

TPanel.Canvas ?

Posted on 1998-12-23
5
229 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
5 Comments
 
LVL 7

Accepted Solution

by:
BlackMan earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Hi blackman. See that you were first :-)
0
 
LVL 1

Expert Comment

by:Smilly
Comment Utility
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
Comment Utility
Smilly u also should release the DC..

ReleaseDC(Panel1.Handle, DC);

Merry Christmas!

-Viktor
--Ivanov
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Delphi 2010 Export to pdf 2 249
Save pdf file to other location 3 72
URL for downloading Google Chrome for Win XP 2 76
LAN or WAN ? 11 58
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now