|
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "ex1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Bt1Click(TObject *Sender)
{
Bt1->Caption="나는?";
/*
txtText = M1->Text=="성이 없습니다." ;
txtText = M2->Text;
txtText = M3->Text;
txtText = M4->Text;
*/
M1 = Text="성이 없습니다.";
M2 = Text="이름이 없습니다.";
M3 = Text="나이가 없습니다.";
M4 = Text="여자친구 이름이 없습니다.";
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if(Mm->Text=="")
{
ShowMessage(M1);
}
if(Mm1->Text=="")
{
ShowMessage(M2);
}
if(Mm2->Text=="")
{
ShowMessage(M3);
}
if(Mm3->Text=="")
{
ShowMessage(M4);
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
if(Rb->Checked==true)
{
if(Mm->Text=="")
{
ShowMessage(M1);
}
if(Mm1->Text=="")
{
ShowMessage(M2);
}
if(Mm2->Text=="")
{
ShowMessage(M3);
}
if(Mm3->Text=="")
{
ShowMessage(M4);
}
else
{
ShowMessage("나는"+Mm->Text+Mm1->Text+"이고,\n"+"나이는"+Mm2->Text+"세이며,\n"+"여자친구는"+Mm3->Text+"입니다.");
}
}
if(Rb->Checked==false)
{
ShowMessage("나는"+Mm->Text+Mm1->Text+"이고,\n"+"나이는"+Mm2->Text+"세이며,\n"+"여자친구는 없습니다.");
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Rb1Click(TObject *Sender)
{
La->Visible=false;
Mm3->Visible=false;
Mm3->Text=" ";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::RbClick(TObject *Sender)
{
La->Visible=true;
Mm3->Visible=true;
}
//---------------------------------------------------------------------------
저의 목표는 TEdit에 입력이 없으면 입력이 없습니다 라고 띠우고 싶으네요
성,이름,나이,여자친구 이름이 없습니다 이런식으로 없는건다 한줄로
한개라도 입력이 안되면 결과값이 출력이 안되게 하고 싶습니다.
짱구를 굴려도 안되서 문의 드려봅니다 ㅎ
|