Recent

Author Topic: (Solved)Components/Graphics Problem Again  (Read 206 times)

JLWest

  • Hero Member
  • *****
  • Posts: 934
(Solved)Components/Graphics Problem Again
« on: October 09, 2020, 10:58:06 pm »
Once I draw a rectangle around a Component say a TEdit in Form onPaint is there anyway to remove the triangle later and then still later restore.

Thanks
« Last Edit: October 10, 2020, 04:34:29 am by JLWest »
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

jamie

  • Hero Member
  • *****
  • Posts: 3797
Re: Components/Graphics Problem Again
« Reply #1 on: October 09, 2020, 11:23:25 pm »
Place some flags somewhere so the Onpaint handler can detect if it should draw a border around a control and have it act on it..
 
 Elsewhere in code you can use Form1.Invalidate and it will force the form to redraw itself thus removing the box you have there.

 But be warn, the OnPaint handler will get called again and this is why you need to set a flag so it does not repaint it.
The only true wisdom is knowing you know nothing

JLWest

  • Hero Member
  • *****
  • Posts: 934
Re: Components/Graphics Problem Again
« Reply #2 on: October 09, 2020, 11:52:55 pm »
hi jamie

Thanks.

I think I have enough now to do what I want to do.
FPC 3.2.0, Lazarus IDE v2.0.4
 Windows 10 Pro 32-GB
 Intel i7 770K CPU 4.2GHz 32702MB Ram
GeForce GTX 1080 Graphics - 8 Gig
4.1 TB

 

TinyPortal © 2005-2018