Difference between revisions of "TTICheckListBox"

From Lazarus wiki
Jump to navigationJump to search
Line 4: Line 4:
 
       TMonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
 
       TMonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
 
       TMonths = set of TMonth;
 
       TMonths = set of TMonth;
 +
      //
 
       TForm1 = class(TForm)
 
       TForm1 = class(TForm)
 
       private
 
       private

Revision as of 09:40, 1 April 2022

For editing set of enumerated types. Let's assume that you have following definitions.

  type
     TMonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec);
     TMonths = set of TMonth;
     //
     TForm1 = class(TForm)
     private
        FMonths: TMonths;
     published
        property Months: TMonths read FMonths write FMonths;
     end;


You can use TTICheckListBox in following way.

     with TICheckListBox1.LInk do begin
         TIObject:= Form1;
         TIPropertyName := 'Months';
     end;