?
Solved

TBordeStyle problem

Posted on 2004-11-02
5
Medium Priority
?
386 Views
Last Modified: 2010-04-05
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 ?

0
Comment
Question by:ginsonic
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 12473548
?? 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
 
LVL 1

Accepted Solution

by:
vacerose earned 2000 total points
ID: 12473571
TBorderStyle is declared in the Forms unit

FList.BorderStyle:=Forms.bsNone;
0
 
LVL 17

Expert Comment

by:geobul
ID: 12473818
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
 
LVL 9

Author Comment

by:ginsonic
ID: 12474157
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
 
LVL 9

Author Comment

by:ginsonic
ID: 12474165
Thanks for support!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Integration Management Part 2
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question