Main form Open Subform && Print pie chart "Typical example of Delphi 6 database Development"--chart drawing

Source: Internet
Author: User

\delphi 6 Typical instance of database development \ Chart Drawing

1. Open the subform in the main form: ShowForm (Tfrm_print);

Procedure Tfrm_main.showform (Aformclass:tformclass);
Begin
With Aformclass.create (self) do
Try
ShowModal; Block or modal window, you can only go to the Father window after you close the current window.
Finally
Free;
End
End

This example opens with an exception, prompting the unit chart reference itself,

Because the project is named Program Chart, and the control class name used is Tchart conflict,

Change the project name to program MyChart; Compile.

2, print pie chart;

1 Implementation2 usesprinters;3 {$R *.DFM}4 5 procedureTfrm_print.btn_printclick (sender:tobject);6 varH,w:longint;7 begin8Screen.cursor: =Crhourglass;9   TryTen Printer.begindoc; One     Try Ah:=Printer.pageheight; -w:=Printer.pagewidth; -  theChart1.printpartial (Rect (wDiv Ten, -HDiv 3 , -W-(WDiv Ten), -H-(hDiv Ten) )); +  - Printer.enddoc; +     except AOn Exception Do at       begin - Printer.abort; - Printer.enddoc; -         Raise; -       End; -     End; in   finally -screen.cursor:=Crdefault; to   End; + End;
Print pie chart

Main form Open Subform && Print pie chart "Typical example of Delphi 6 database Development"--chart drawing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.