Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
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;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Delphi Spellcheck in Webbrowser||1||52|
|Installshield for Embarcadero EX 10.1 Berlin||4||74|
|Delphi XE7 Firemonkey - text turns black after tabbing between applications on android||5||75|
|What is the advantage to have a function or procedure created inside another function or procedure?||2||38|