Firefighter 1966
Grünschnabel
Um Bei einem Textfeld einen oder mehrere Zeielnumbruch ausdrucken zu können
bin auf ein Problem gestoßen!
in Memo 2 druckt er keine zeilen umbrüche
kann mir einer helfen?
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Printers.hpp>
#include <String.h>
#include <sysmac.h>
#pragma hdrstop
#include <iostream.h>
#include "main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Memo2->Lines->Text=RichEdit1->Lines->GetText();
Memo3->Lines->Text=RichEdit1->Lines->Text;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Beenden1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
PrintDialog1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1:rucken1Click(TObject *Sender)
{
TPrinter *test = new TPrinter;
String einsatzbericht[230];
if(PrintDialog1->Execute()==true)
{
test=Printer();
//----Drucken des Einsatzberichtes Einsatzleiter-------------------
test->BeginDoc();
Memo2->Lines->Text=RichEdit1->Lines->GetText();
test->Canvas->TextOutA(770,1490,Memo2->Lines->Text);
test->Canvas->TextOutA(770,1580,Memo3->Lines->Text);
test->Canvas->TextOutA(770,1670,Memo4->Lines->Text);
test->Canvas->TextOutA(900,1760,Memo5->Lines->Text);
test->Canvas->TextOutA(1000,1950,Memo6->Lines->Text);
test->Canvas->TextOutA(1000,2040,Memo7->Lines->Text);
test->Canvas->TextOutA(700,2230,Edit44->Text);
test->Canvas->TextOutA(2000,2230,Edit45->Text);
test->EndDoc();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
String einsArt[10];
//----Auswählen der Einsatzart-------------------------------
switch(ComboBox1->ItemIndex)
{
case 0: Edit46->Text="B1";
break;
case 1: Edit46->Text="B2";
break;
case 2: Edit46->Text="B3";
break;
case 3: Edit46->Text="PTuer";
break;
case 4: Edit46->Text="Pklemm";
break;
default: Edit46->Text="nicht ausgewählt";
}
TPrinter *fahrzeuge = new TPrinter;
if(PrintDialog2->Execute()==true)
{
fahrzeuge=Printer();
//----Drucken von EinsatzberichtFahrzeuge-------------------
fahrzeuge->BeginDoc();
fahrzeuge->Canvas->TextOutA(0,0,Edit1->Text);
fahrzeuge->Canvas->TextOutA(0,50,Edit2->Text);
fahrzeuge->Canvas->TextOutA(0,100,Edit3->Text);
fahrzeuge->Canvas->TextOutA(0,150,Edit46->Text);
/*test->Canvas->TextOutA(0,200,Memo5->Lines->Text);
test->Canvas->TextOutA(0,250,Memo6->Lines->Text);
test->Canvas->TextOutA(0,300,Memo7->Lines->Text);
test->Canvas->TextOutA(0,350,Edit44->Text);
test->Canvas->TextOutA(0,400,Edit45->Text);*/
fahrzeuge->EndDoc();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RichEdit1Change(TObject *Sender)
{
}
//---------------------------------------------------------------------------
bin auf ein Problem gestoßen!
in Memo 2 druckt er keine zeilen umbrüche
kann mir einer helfen?
//---------------------------------------------------------------------------
#include <vcl.h>
#include <Printers.hpp>
#include <String.h>
#include <sysmac.h>
#pragma hdrstop
#include <iostream.h>
#include "main.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Memo2->Lines->Text=RichEdit1->Lines->GetText();
Memo3->Lines->Text=RichEdit1->Lines->Text;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Beenden1Click(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
PrintDialog1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1:rucken1Click(TObject *Sender)
{
TPrinter *test = new TPrinter;
String einsatzbericht[230];
if(PrintDialog1->Execute()==true)
{
test=Printer();
//----Drucken des Einsatzberichtes Einsatzleiter-------------------
test->BeginDoc();
Memo2->Lines->Text=RichEdit1->Lines->GetText();
test->Canvas->TextOutA(770,1490,Memo2->Lines->Text);
test->Canvas->TextOutA(770,1580,Memo3->Lines->Text);
test->Canvas->TextOutA(770,1670,Memo4->Lines->Text);
test->Canvas->TextOutA(900,1760,Memo5->Lines->Text);
test->Canvas->TextOutA(1000,1950,Memo6->Lines->Text);
test->Canvas->TextOutA(1000,2040,Memo7->Lines->Text);
test->Canvas->TextOutA(700,2230,Edit44->Text);
test->Canvas->TextOutA(2000,2230,Edit45->Text);
test->EndDoc();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
String einsArt[10];
//----Auswählen der Einsatzart-------------------------------
switch(ComboBox1->ItemIndex)
{
case 0: Edit46->Text="B1";
break;
case 1: Edit46->Text="B2";
break;
case 2: Edit46->Text="B3";
break;
case 3: Edit46->Text="PTuer";
break;
case 4: Edit46->Text="Pklemm";
break;
default: Edit46->Text="nicht ausgewählt";
}
TPrinter *fahrzeuge = new TPrinter;
if(PrintDialog2->Execute()==true)
{
fahrzeuge=Printer();
//----Drucken von EinsatzberichtFahrzeuge-------------------
fahrzeuge->BeginDoc();
fahrzeuge->Canvas->TextOutA(0,0,Edit1->Text);
fahrzeuge->Canvas->TextOutA(0,50,Edit2->Text);
fahrzeuge->Canvas->TextOutA(0,100,Edit3->Text);
fahrzeuge->Canvas->TextOutA(0,150,Edit46->Text);
/*test->Canvas->TextOutA(0,200,Memo5->Lines->Text);
test->Canvas->TextOutA(0,250,Memo6->Lines->Text);
test->Canvas->TextOutA(0,300,Memo7->Lines->Text);
test->Canvas->TextOutA(0,350,Edit44->Text);
test->Canvas->TextOutA(0,400,Edit45->Text);*/
fahrzeuge->EndDoc();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RichEdit1Change(TObject *Sender)
{
}
//---------------------------------------------------------------------------
Zuletzt bearbeitet: