Board index » cppbuilder » TToolbar and TToolButton
Totte Karlsson
CBuilder Developer |
Totte Karlsson
CBuilder Developer |
TToolbar and TToolButton2004-01-12 07:52:34 AM cppbuilder85 Hi, I want to create a TToolButton at runtime and add it to a TToolBar. In the Help for TToolButton, it says to use the function SetToolBar, so I wrote TToolButton* btn = new TToolButton(this); btn->SetToolBar(toolBar); and I get error saying that SetToolBar is not accesible, What's the right way to add a TToolButton to a TToolBar at runtime? thanks, /totte |
Remy Lebeau (TeamB)
CBuilder Developer |
2004-01-12 11:19:55 AM
Re:TToolbar and TToolButton
"Totte Karlsson" < XXXX@XXXXX.COM >wrote in message
QuoteI wrote QuoteWhat's the right way to add a TToolButton to a TToolBar at runtime? class TMyToolButton : public TToolButton { public: __fastcall TMyToolButton(TComponent *Owner); __property TToolBar* ToolBar = {read=FToolBar, write=SetToolBar}; }; Then at runtime you can instantiate an instance of your descendant instead of TToolButton directly and then set its ToolBar property: TMyToolButton *btn = new TMyToolButton(this); btn->ToolBar = toolBar; Why the native TToolButton does not already declare such a property, I do not know. Gambit |
Todd Brylski
CBuilder Developer |
2004-01-12 02:42:16 PM
Re:TToolbar and TToolButton
"Totte Karlsson" < XXXX@XXXXX.COM >wrote in message news:4001e217$ XXXX@XXXXX.COM ...
QuoteHi, todd {smallsort} |
Totte Karlsson
CBuilder Developer |
2004-01-13 12:04:39 PM
Re:TToolbar and TToolButton
Thanks,
I got it working using the Parent property. Its weird that help lists the SetToolBar function? thanks /totte "Totte Karlsson" < XXXX@XXXXX.COM >wrote in message QuoteHi, |
Remy Lebeau (TeamB)
CBuilder Developer |
2004-01-13 01:12:30 PM
Re:TToolbar and TToolButton
"Totte Karlsson" < XXXX@XXXXX.COM >wrote in message
QuoteIts weird that help lists the SetToolBar function? internally. Gambit |
Totte Karlsson
CBuilder Developer |
2004-01-14 12:49:30 AM
Re:TToolbar and TToolButton
well, I just ment that it's not too much help, since it is private,
therefore, it should not be in the help file.. or they should say it's private at least. /tk "Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >wrote in message Quote
|