1. ³ . File/Save as File/Save Project as Unit1.cpp Project1.bpr V- .
2. Label4, RadioGroup1 ListBox2 , StringGrid ( Additional ) :
ColCount 3 (- )
RowCount 4 (- )
FixedCols 0 (- )
FixedRows 1 (- )
:
3. ( , ) 䳺 OnCreate :
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
int I;
StringGrid1->Cells[0][0]=" ";
StringGrid1->Cells[1][0]="";
StringGrid1->Cells[2][0]="";
for (I=1; I<=K; I++)
{
StringGrid1->Cells[0][I]=Nv[I-1];
StringGrid1->Cells[1][I]=FloatToStr(Kv[I-1][0]);
StringGrid1->Cells[2][I]=FloatToStr(Kv[I-1][1]);
}
}
StringGrid1 Cells, , ( , ). Nv Kv ( ) implementation :
const K=3;
char *Nv[K]={"USD", "Euro", "RusRuble"};
const double Kv[K][2]={5.05,5.15,6.1,6.2,0.15,0.16};
4. 䳿 OnClick RadioButton1 RadioButton2 :
void __fastcall TForm1::RadioButton1Click(TObject *Sender)
{
Label3->Caption="";
Label7->Caption=" ";
}
//-------------------------------------------------------------------
void __fastcall TForm1::RadioButton2Click(TObject *Sender)
{
Label3->Caption="";
Label7->Caption=" ";
}
5. 䳿 OnClick Edit2 :
void __fastcall TForm1::Edit2Change(TObject *Sender)
{
if (RadioButton1->Checked)
Edit3->Text=FloatToStr(StrToInt(Edit2->Text)*
Kv[StringGrid1->Row-1][0]);
else
Edit3->Text=FloatToStr(StrToInt(Edit2->Text)*
Kv[StringGrid1->Row-1][1]);
}
Row StringGrid1 .
6. C++ Builder. :
exe- Widows.
Edit2 is not a valid integer value. ǒ, .