Kontaktlarni saqlovchi soda dastur uchun ikta forma oynasidan foydalandik


Download 53.06 Kb.
bet2/2
Sana09.06.2023
Hajmi53.06 Kb.
#1474130
1   2
Bog'liq
Raxmatillo toirov 2-dedline

Blaknot dasturi:

Dastur kodi:


Kod qismi.
//---------------------------------------------------------------------------

#include


#pragma hdrstop

#include "Unit1.h"


//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
String fn;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Yangi1Click(TObject *Sender)
{
if(RichEdit1->Modified)
{
switch (MessageDlg("Ma'lumotlar o'zgargan. Saqlaysizmi",
mtConfirmation,mbYesNoCancel,0
)) {
case mrYes: Saqlash1->Click(); break;
case mrNo: RichEdit1->Clear(); break;
case mrCancel: break;
default:
;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Yangisaqlash1Click(TObject *Sender)
{
if(SaveTextFileDialog1->Execute())
{
RichEdit1->Lines->SaveToFile(SaveTextFileDialog1->FileName);
fn = SaveTextFileDialog1->FileName;
Form1->Caption = fn;
RichEdit1->Modified = false;
}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Ochish1Click(TObject *Sender)


{
OpenTextFileDialog1->Execute();
RichEdit1->Lines->LoadFromFile(OpenTextFileDialog1->FileName);
fn = OpenTextFileDialog1->FileName;
Form1->Caption = fn;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Saqlash1Click(TObject *Sender)


{
if(fn.IsEmpty())
{
Yangisaqlash1->Click();
}
else
{
RichEdit1->Lines->SaveToFile(fn);
RichEdit1->Modified = false;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Chiqish1Click(TObject *Sender)
{
if(RichEdit1->Modified)
{
switch (MessageDlg("Ma'lumotlar o'zgargan. Saqlaysizmi",
mtConfirmation,mbYesNoCancel,0
)) {
case mrYes: Saqlash1->Click(); Close(); break;
case mrNo: Close(); break;
case mrCancel:
Abort();
break;
default:
;
}
}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Chopetish1Click(TObject *Sender)


{
PrintDialog1->Execute();
RichEdit1->Print(RichEdit1->Text);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Qirqish1Click(TObject *Sender)


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

void __fastcall TForm1::Nushalash1Click(TObject *Sender)


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

void __fastcall TForm1::Joylash1Click(TObject *Sender)


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

void __fastcall TForm1::Barchasinibelgilash1Click(TObject *Sender)


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

void __fastcall TForm1::Shrift1Click(TObject *Sender)


{
FontDialog1->Execute();
RichEdit1->Font = FontDialog1->Font;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Qirqish2Click(TObject *Sender)


{
Qirqish1->Click();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Nusxalash1Click(TObject *Sender)


{
Nusxalash1->Click();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Joylash2Click(TObject *Sender)


{
Joylash1->Click();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Barjasinibelgilash1Click(TObject *Sender)


{
Barchasinibelgilash1->Click();
}
//---------------------------------------------------------------------------

Download 53.06 Kb.

Do'stlaringiz bilan baham:
1   2




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling