On a form, place a TPanel. Set its Left to 50; Set its Top to 50; Set its BorderStyle = bsSingle Set BorderWidth to 1 // (this doesn't actually matter, it can also be 0). //Paint onto the forms canvas by putting a TButton with this OnClick event: procedure TForm1.Button1Click(Sender: TObject); var C : TCanvas; MyHDC : HDC; begin C := TCanvas.Create; with C do try MyHDC := GetWindowDC(self.handle); try Handle := MyHDC; Brush.Style := bsSolid; Pen.Width := 8; Rectangle(Rect(10,10,100,100)); finally ReleaseDC(self.handle, MyHDC); end; finally Free; end; //NOW REPAINT THE PANEL Panel1.Repaint; //NOW REPAINT THE FORM self.repaint; end; //THE SOLUTION: panel1.BorderStyle := bsNone; panel1.BorderStyle := bsSingle;
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE