[Solved] Line drawn is immediately deleted lazarus / 21-General ---------------------------------------------------------------------- nikel · 2025-01-04 13:01 Hello, I'm trying to draw a line under my radio button. I couldn't make it work. To test, when I draw a line and set the it's parent to form, and run it, the line is immediately deleted. Here's my code so far: 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 FPanels[I]. Canvas.Pen.Color:=clWhite;FPanels[I].Canvas.Pen.Width:=3;FPanels[I].Ca nvas.Line(0, 23, 25, 23); How can I draw a line under my radio button? ---------------------------------------------------------------------- cdbc · 2025-01-04 13:10 Hi I told you already!!! Use the 'OnPaint' event of the 'TPanel' it's concerning, otherwise the painting won't stay! Hrmpf - /b edit: Your job is to find a way, to make all the panels use the same event-handler... So you don't need 100 different, but equivalent OnPaint-handlers... ---------------------------------------------------------------------- VisualLab · 2025-01-04 17:09 I'm not sure if you mean a window with several panels on which radio buttons are placed, but it can be done as in the screenshot. I'm attaching a project made in Lazarus. Of course, what I gave in the example is just one way to solve the task.