Impression borland c++

cs_Tulipe Messages postés 1 Date d'inscription jeudi 30 mai 2002 Statut Membre Dernière intervention 30 mai 2002 - 30 mai 2002 à 10:45
cs_st1 Messages postés 13 Date d'inscription lundi 24 juin 2002 Statut Membre Dernière intervention 29 décembre 2002 - 10 juil. 2002 à 13:06
A l'aide besoin d'imprimer données en c++ avec borland c++.Merci

1 réponse

cs_st1 Messages postés 13 Date d'inscription lundi 24 juin 2002 Statut Membre Dernière intervention 29 décembre 2002
10 juil. 2002 à 13:06
//ST1
//voila un exemple mais oui C++Builder V5
/*Utilisation du composant TPrintDialog, qui fait parti de la palette Dialogs tu peux completer l'exemple avec le composant TPrintSetupDialog*/

void __fastcall TForm1::Button1Click(TObject *Sender)

{
PrintDialog1->Options.Clear();
PrintDialog1->Options << poPageNums << poSelection;
PrintDialog1->FromPage = 1;
PrintDialog1->MinPage = 1;
PrintDialog1->ToPage = PageControl1->PageCount;
PrintDialog1->MaxPage = PageControl1->PageCount;
if (PrintDialog1->Execute())
{
int Start, Stop;
// determine the range the user wants to print
switch (PrintDialog1->PrintRange)
{
case prSelection:Start =
PageControl1->ActivePage->PageIndex;
Stop = Start;
break;
case prPageNums:
Start = PrintDialog1->FromPage - 1;
Stop = PrintDialog1->ToPage - 1;
break;
default:
Start = PrintDialog1->MinPage - 1;
Stop = PrintDialog1->MaxPage - 1;
break;
}

Printer()->BeginDoc();
for (int i = Start; i <= Stop; i++)
{
PageControl1->Pages[i]->PaintTo(Printer()->Handle, 10, 10);
if (i != Stop)
Printer()->NewPage();
}
Printer()->EndDoc();
}
}
0
Rejoignez-nous