Board index » delphi » TButton.Create vs. TBevel.Create

TButton.Create vs. TBevel.Create

Greetings.
I am Ralez.

This is a line from my code where I create a button on the form called
Form1. This button's name is ArrButt[a] where "a" is an integer with a
valur. No problem here.

ArrButt[a] := TButton.Create(Form1);

However, if I want to use a line like:

ArrButt[a] := TBevel.Create(Form1);

then Delphi comes up with an error message, saying it doesn't
recognize the object TBevel, though the object I can use everywhere if
I draw it normally, and everything indicates that its object name is
TBevel.

I tried a few other TObjects as well, and most of them work, except a
few ones like TBevel and some other that take just about as much part
in a program. Buttons, text fields and captions are used wildly and
freely, but those who seem to be for no purpose but to stay untouched
on a form (though they of course can always be altered), Delphi seems
to look at these TObjects in some other way, making anyone unable to
create such a TObject during run-time.

Please help me with this problem if you can, and thanx in advance. :)

PEACE & LOVE!

Ralez

 

Re:TButton.Create vs. TBevel.Create


Quote
Ralez (ra...@islandia.is) wrote:

<snip>
: However, if I want to use a line like:

: ArrButt[a] := TBevel.Create(Form1);

: then Delphi comes up with an error message, saying it doesn't
: recognize the object TBevel, though the object I can use everywhere if
: I draw it normally, and everything indicates that its object name is
: TBevel.

Check in the online help to see which unit defines TBevel, and
make sure that unit is in your "uses" statement, and add it if
necessary.  Delphi automatically adds units to "uses" when you
add visual components, but you need to add the units for things
you create in your code.
--
============================================================
Rick Carter   carte...@email.uc.edu   rcar...@tso.cin.ix.net
============================================================

Other Threads