Using CreateButton

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Torben Laursen
Newbie
Newbie
Posts: 4
Joined: Fri Sep 10, 2004 4:00 am

Using CreateButton

Post by Torben Laursen » Mon Sep 13, 2004 9:11 pm

Hi

I'm trying to add a button to a TTeeCommander in C++ builder 6.0 using version 7.01 of Tchart

I drop a TTeecommander and a TButton on a form and add this code:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
TeeCommander1->CreateButton(310, Button1Click, "Open", "", 0);
}

It will not compile with this error:
[C++ Error] Unit1.cpp(20): E2285 Could not find a match for 'TCustomTeeCommander::CreateButton(int,void,char *,char *,int)'

What file do I need to include?
TeeComma.hpp is allready included

Thanks Torben Laursen

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Tue Sep 14, 2004 7:03 am

Hi, Torben.

For BCB you have to use slightly different approach. The following code works fine though:

Code: Select all

__fastcall TForm1::TForm1(TComponent* Owner)
  : TForm(Owner)
{
  TSpeedButton *btn = TeeCommander1->CreateButton(300,&SpeedButton1Click,"Custom","",0);
}
//---------------------------------------------------------------------------

void __fastcall TForm1::SpeedButton1Click(TObject *Sender)
{
  ShowMessage("Hello world!");
}
Marjan Slatinek,
http://www.steema.com

Post Reply