[Solved] How to display linetypes in combobox? lazarus / 39-Graphics ---------------------------------------------------------------------- loaded · 2021-07-30 05:10 Hi All, I am drawing different types of lines in the application with the following sample code. How can I visually load the shapes of the drawable line types in the most practical way into the combobox? I would really appreciate if you can help. Respects. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.Button1Click(Sender: TObject);var  y:integer=0;begin  inc(y,10); canvas.Pen.Style:=psSolid; canvas.Line(10,y,100,y);  inc(y,10); canvas.Pen.Style:=psDash; canvas.Line(10,y,100,y);  inc(y,10); canvas.Pen.Style:=psDashDot; canvas.Line(10,y,100,y);  inc(y,10); canvas.Pen.Style:=psDashDotDot; canvas.Line(10,y,100,y);  inc(y,10); canvas.Pen.Style:=psDot; canvas.Line(10,y,100,y);  ComboBox1.Clear;  ComboBox1.Items.Add('psSolid');  ComboBox1.Items.Add('psDash');  ComboBox1.Items.Add('psDashDot');  ComboBox1.Items.Add('psDashDotDot');  ComboBox1.Items.Add('psDot');end; ---------------------------------------------------------------------- paweld · 2021-07-30 06:07 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormCreate(Sender: TObject);begin  ComboBox1.Items.Clear;  ComboBox1.Style := csOwnerDrawVariable;  ComboBox1.Items.Add('Solid');  ComboBox1.Items.Add('Dash');  ComboBox1.Items.Add('DashDot');  ComboBox1.Items.Add('DashDotDot');  ComboBox1.Items.Add('Dot');end; procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer; ARect: TRect; State: TOwnerDrawState);begin  case (Control as TComboBox).Items[Index] of    'Solid': (Control as TComboBox).Canvas.Pen.Style := psSolid;    'Dash': (Control as TComboBox).Canvas.Pen.Style := psDash;    'DashDot': (Control as TComboBox).Canvas.Pen.Style := psDashDot;    'DashDotDot': (Control as TComboBox).Canvas.Pen.Style := psDashDotDot;    'Dot': (Control as TComboBox).Canvas.Pen.Style := psDot;  end;  (Control as TComboBox).Canvas.Pen.Width := 3;  (Control as TComboBox).Canvas.Pen.Color := clBlack;  (Control as TComboBox).Canvas.Line(ARect.Left, ARect.Top + (ARect.Height div 2), ARect.Left + 150, ARect.Top + (ARect.Height div 2));  (Control as TComboBox).Canvas.TextOut(ARect.Left + 160, ARect.Top, (Control as TComboBox).Items[Index]);end; ---------------------------------------------------------------------- loaded · 2021-07-30 06:39 paweld, Thank you very much for taking your precious time to reply. that's what i wanted. ---------------------------------------------------------------------- wp · 2021-07-30 10:50 The unit TChartComboBox in unit TAChartCombos of the TAChart package allows to select a pen style when property Mode is switched to ccmPenStyle. Likewise, you can select a pen width or a brush style when Mode is ccmPenWidth or ccmBrushStyle, respectively. Since it also allows to select a series pointer style the unit is interweaved with other TAChart units and thus cannot extracted easily. ---------------------------------------------------------------------- loaded · 2021-07-30 12:08 Thanks a lot wp master, this information was also very good.