TBordeStyle problem

I have:

type
  TBorderStyle      =  (bsNone, bs3D, bsFlatSingle, bsFlatDouble);

type
  TVCL1             =  class(TCustomControl)
  private
     // Private declarations
     FBorder:       TBorderStyle;
     FVCL2:         TVCL2;
     FList:            TListView;
  protected
     // Protected declarations
     procedure      SetBorder(Value: TBorderStyle);
  public
     constructor    Create(AOwner: TComponent); override;
     destructor     Destroy; override;
  published
     property       Border: TBorderStyle read FBorder write SetBorder default bs3D;
  end;

At Create I wish to assign to listview a bsNone border but get error.

I use
  FVCL2.BorderStyle:= VCL2.bsNone; // work PERFECT
  FList.BorderStyle:=ListView.bsNone; // error ListView unknown. I have ComCtrls in my units

What to do to can assign bsNone to my FList ?

LVL 9
ginsonicAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
?? just asking why you redeclare the BorderStyle Type

would it not be enough to include the unit, where it is declarded (controls i guess)
0
vaceroseCommented:
TBorderStyle is declared in the Forms unit

FList.BorderStyle:=Forms.bsNone;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
geobulCommented:
Hi,

What is VCL2 and why does 'FVCL2.BorderStyle:= VCL2.bsNone; // work PERFECT' work?

I suspect that VCL2 is the unit name where your own TBorderStyle is declared, right? But here is no unit named ListView. So, the second line fails.

If the above is correct then:
FList.BorderStyle:=VCL2.bsNone;
should give you incompatible types (TBorderStyle) because Forms.TBorderStyle is not compatible with your own type.

So, the only solution is as vacerose already said, i.e. Forms.bsNone;

Regards, Geo
0
ginsonicAuthor Commented:
TBorderStyle      =  (bsNone, bs3D, bsFlatSingle, bsFlatDouble); is a little different by standard TBorderStyle :) Take a look to the last two values.

The TBorderStyle is declared into bouth units, This is the reason of FVCL2:=VCL2.bsNone. Elese a FVCL2:=bsNone will be enough.
0
ginsonicAuthor Commented:
Thanks for support!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.