Скачиваний:
2
Добавлен:
30.05.2020
Размер:
3.36 Кб
Скачать
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "U2B.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2B *Form2B;
//---------------------------------------------------------------------------
__fastcall TForm2B::TForm2B(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Button1Click(TObject *Sender)
{
float a1,a2,a3,a4;
if((Edit1->Text).Length()==0 ||(Edit2->Text).Length()==0 ||(Edit3->Text).Length()==0
||(Edit4->Text).Length()==0)
ShowMessage("Ви ввели не всі поля.Для роботи програми заповніть всі поля!"); else{
a1=StrToFloat(Edit1->Text);
a2=StrToFloat(Edit2->Text);
a3=StrToFloat(Edit3->Text);
a4=StrToFloat(Edit4->Text);
if (a1==a2==a3==a4)
Memo1->Lines->Add("Jlyfrjds");
if ((a1==a2) && (a2==a3))
Memo1->Lines->Add("Відрізняеться a4= "+ FloatToStrF(a4,ffFixed,8,0));
else if ((a1==a2) && (a2==a4))
 Memo1->Lines->Add("Відрізняеться a3= "+ FloatToStrF(a3,ffFixed,8,0));
else if ((a1==a3) && (a3==a4))
 Memo1->Lines->Add("Відрізняеться a2= "+ FloatToStrF(a2,ffFixed,8,0));
else if ((a2==a3) && (a3==a4))
Memo1->Lines->Add("Відрізняеться a1= "+ FloatToStrF(a1,ffFixed,8,0));
} }
void __fastcall TForm2B::Button2Click(TObject *Sender)
{
Edit1->Clear();
Edit2->Clear();
Edit3->Clear();
Edit4->Clear();
Memo1->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::FormCreate(TObject *Sender)
{
  Memo1->Clear();
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Button3Click(TObject *Sender)
{
Form2B->Close();
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Edit1KeyPress(TObject *Sender, char &Key)
{
if (((Key>='0') && (Key<='9')) || (Key==VK_BACK) || (Key==',') || (Key=='-'))
  return;
if (Key==VK_RETURN)
  Button1->SetFocus();
Key=0;                
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Edit2KeyPress(TObject *Sender, char &Key)
{
if (((Key>='0') && (Key<='9')) || (Key==VK_BACK) || (Key==',') || (Key=='-'))
  return;
if (Key==VK_RETURN)
  Button1->SetFocus();
Key=0;                
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Edit3KeyPress(TObject *Sender, char &Key)
{
if (((Key>='0') && (Key<='9')) || (Key==VK_BACK) || (Key==',') || (Key=='-'))
  return;
if (Key==VK_RETURN)
  Button1->SetFocus();
Key=0;                
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Edit4KeyPress(TObject *Sender, char &Key)
{
if (((Key>='0') && (Key<='9')) || (Key==VK_BACK) || (Key==',') || (Key=='-'))
  return;
if (Key==VK_RETURN)
  Button1->SetFocus();
Key=0;                
}
//---------------------------------------------------------------------------

void __fastcall TForm2B::Memo1KeyPress(TObject *Sender, char &Key)
{
Key=0;        
}
//---------------------------------------------------------------------------

Соседние файлы в папке 2
  • #
    30.05.202018.72 Кб1Project2B.obj
  • #
    30.05.2020876 б1Project2B.res
  • #
    30.05.20202.03 Mб1Project2B.tds
  • #
    30.05.20203.72 Кб1Project2B.~bpr
  • #
    30.05.20201.07 Кб1Project2B.~cpp
  • #
    30.05.20203.36 Кб2U2B.cpp
  • #
    30.05.202051 б1U2B.ddp
  • #
    30.05.20203.84 Кб1U2B.dfm
  • #
    30.05.20201.65 Кб1U2B.h
  • #
    30.05.202047.19 Кб1U2B.obj
  • #
    30.05.20203.16 Кб1U2B.~cpp