Recent

Author Topic: [SOLVED] Set DrawStyle to dynamic created button  (Read 2465 times)

tudi_x

  • Hero Member
  • *****
  • Posts: 532
[SOLVED] Set DrawStyle to dynamic created button
« on: June 29, 2016, 10:27:42 am »
Hi!
I am trying to create buttons dynamically on a form using Lazarus 1.6 on Windows 7.
When setting the DrawStyle property as in the below I am getting 'Identifier not found dsWindows7'.
Please advise what I am missing.

Code: Pascal  [Select][+][-]
  1. PROCEDURE TForm1.AddPlusBtn(LastOYPos : INTEGER);
  2. CONST
  3.   btnHeight = 24;
  4.   btnWidth = 24;
  5.   btnLeft = 24;
  6.   btnDistBtw = 10;
  7.  
  8. VAR
  9.   btnPlus : TCDButton;
  10.  
  11. BEGIN
  12.   btnPlus := TCDButton.Create(Form1);
  13.   btnPlus.Parent := Form1;
  14.   btnPlus.Height := btnHeight;
  15.   btnPlus.Width := btnWidth;
  16.   btnPlus.Left := btnLeft;
  17.   btnPlus.Top := LastOYPos + btnDistBtw;
  18.   btnPlus.Visible := True;
  19.   btnPlus.Enabled := True;
  20.  
  21.   btnPlus.DrawStyle := dsWindows7;
  22.  
  23.   btnPlus.Caption := '+';
  24. END;      
  25.  

Thank you.
« Last Edit: June 29, 2016, 05:25:10 pm by tudi_x »
Lazarus 2.0.2 64b on Debian LXDE 10

tudi_x

  • Hero Member
  • *****
  • Posts: 532
Re: Set DrawStyle to dynamic created button
« Reply #1 on: June 29, 2016, 05:24:48 pm »
It worked after adding unit customdrawndrawers.
Lazarus 2.0.2 64b on Debian LXDE 10

 

TinyPortal © 2005-2018