Visual c++ muhitida bloknot dasturini tuzish



Yüklə 275,28 Kb.
tarix08.06.2023
ölçüsü275,28 Kb.
#126739
Xomudjonov Samandar



Visual c++ muhitida bloknot dasturini tuzish
//---------------------------------------------------------------------------

#include


#pragma hdrstop

#include "Unit1.h"


//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
bool saved;
AnsiString fileName;

//---------------------------------------------------------------------------


__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Save1Click(TObject *Sender)


{

SaveDialog1->Execute();


Memo1->Lines->SaveToFile(SaveDialog1->FileName);

}
//---------------------------------------------------------------------------


void __fastcall TForm1::Open1Click(TObject *Sender)
{
OpenDialog1->Execute();
Memo1->Lines->LoadFromFile(OpenDialog1->FileName) ;

}
//---------------------------------------------------------------------------


void __fastcall TForm1::Cut1Click(TObject *Sender)


{
Memo1->CutToClipboard();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Copy1Click(TObject *Sender)


{
Memo1->CopyToClipboard();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Paste1Click(TObject *Sender)


{
Memo1->PasteFromClipboard();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Delate1Click(TObject *Sender)


{
Memo1->Clear();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::N4Click(TObject *Sender)
{
FontDialog1->Execute();
Memo1->Font=FontDialog1->Font;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::N1Click(TObject *Sender)


{
Memo1->SelectAll();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Datatime1Click(TObject *Sender)


{
Memo1->Lines->Add(DateTimeToStr(Now()));
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Exit1Click(TObject *Sender)


{
Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Dasturdanchiqish1Click(TObject *Sender)


{
if (Memo1->Modified) {
int res = MessageDlg("Saqlaysizmiq",mtWarning,TMsgDlgButtons()< if(res == mrYes)
{
if (!saved) {
if (SaveDialog1->Execute()) {
fileName = SaveDialog1->FileName;
saved = true;
Memo1->Lines->SaveToFile(fileName);
}
}
else
{
Memo1->Lines->SaveToFile(fileName);
}
Memo1->Modified = false;
Close();
}
else
if (res == mrNo)
{
Close();
}
}
else
{
Close();
}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Fined1Click(TObject *Sender)


{

if (ColorDialog1->Execute())


Memo1->Color=ColorDialog1->Color;

}
//---------------------------------------------------------------------------
Yüklə 275,28 Kb.

Dostları ilə paylaş:




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin