devxlogo

Gaining control after form is minimized

Gaining control after form is minimized

Question:
I have a Delphi app that displays a bitmap, and I control drawing on the canvas object as one might on a paper roadmap. This works fine. When I minimize the app down to the Win95 bar and thenactivate the program again, I want to gain controlto refresh the drawing, since it is not part of the BMP file. I have tried all of the Tform eventprocessing (for example, OnActivate) but without success .

Answer:
You can get a form to redraw itself by calling its Invalidate method. Thiswill force a repaint of all the form’s controls.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist