my q


Enter a number of integer values in the first edit box. Click Accept button after each entry in order to accept the integer number. Clear the edit box after each entry and set focus to the edit box again in order to enter the next integer number.
• If you press on “Sum” button, the summation of all negative numbers will be found and the result will be displayed in the result edit box.
• If you press on “Count” button, the result which will count the number of all non-zero odd numbers will be displayed in the result edit box.
• If you press on “Color” button, the memo’s color will be changed to another color and if you press on the button again then the previous color will be displayed again.
• If you press on “Exit” button, all edit boxes will be cleared and the statement “Thank you” will be printed on the memo called memo1.
• If you press on “Close” button, then the application will be closed.

my solve

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

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button3Click(TObject *Sender)
{
if (Memo1->Color == clYellow)

Memo1->Color = clBlack;

else

Memo1->Color = clYellow;

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

void __fastcall TForm1::Button6Click(TObject *Sender)
{
Close();

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


can any one chesk my solve
and thankes c++ bulder
Last edited on
Topic archived. No new replies allowed.