how to auto call button functions

hi, i have code as below. I will show message if i click the button.

how to make it auto call so that after 1sec,the message will appear without clicking the button. thanks

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

void __fastcall TForm1::Button1Click(TObject *Sender)
{

Sleep(1000);
ShowMessage("testing 123");


}
//---------------------------------------------------------------------------
hi, is there any other options like using " call " or something like that ? thanks
crazydude80 wrote:
hi, is there any other options like using " call " or something like that ?

What about actually reading comments?
shadow123 wrote:
http://www.functionx.com/bcb/controls/timer.htm

Should be good enough.
hi,thanks for the reply but what im trying to do is add wav sound to the program based on below condition. If meet condition (pass) will play WAVE SOUND and if doesnt meet the condition (fail) below will play another wave sound. thought of auto call the Button4Click for fail and Button5Click for pass but not sure how to do it. any idea ?

sorry for the trouble n thanks for ur prompt reply.

Condition:
//----------------------------------------------------------------------------

if(_hsastat&&_spdlstat){
Synchronize(createMainAsmData);
_status=TMainFormB::DATA_OK;
_ErrMsg=" Data Transfer Comp "+_serial;

----------------------------------------------------------------------------
//wave example

void __fastcall TMainFormB::Button4Click(TObject *Sender)

{
MediaPlayer1->FileName = "error_alarm.wav";
MediaPlayer1->AutoRewind = true;
MediaPlayer1->Open(); // Open the media player
try
{
MediaPlayer1->Wait = true; // don’t return until playing is done
MediaPlayer1->Play(); // Play sound
// MediaPlayer1->Play(); // Play again after first play is completed
}
__finally
{
MediaPlayer1->Close(); // Close media player
}

}
any1 can guide me ? thanks
Topic archived. No new replies allowed.