TBordeStyle problem

Posted on 2004-11-02
Last Modified: 2010-04-05
I have:

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

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

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 ?

Question by:ginsonic
    LVL 27

    Expert Comment

    ?? just asking why you redeclare the BorderStyle Type

    would it not be enough to include the unit, where it is declarded (controls i guess)
    LVL 1

    Accepted Solution

    TBorderStyle is declared in the Forms unit

    LVL 17

    Expert Comment


    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:
    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
    LVL 9

    Author Comment

    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.
    LVL 9

    Author Comment

    Thanks for support!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
    Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now