Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Pop up form not painting


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Feb 13, 2018 1:11 AM Last Post By: Mark Williams Threads: [ Previous | Next ]
Mark Williams

Posts: 120
Registered: 5/8/10
Pop up form not painting  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2018 1:53 AM
The component is a popup form. It contains various components. A label which is aligned to the top and a panel (aligned alClient) which is a container for other components.

If I call the form with a simple show command, it paints fully. However, the calling form is deactivated and the popup form activated, which I would like to avoid.

I have tried showing the form using ShowWindow and SetWindowPos with no activation flag set in each case. This shows the form and paints the top label, but doesn't paint the panel and its child components.
Mark Williams

Posts: 120
Registered: 5/8/10
Re: Pop up form not painting  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 11, 2018 4:35 AM   in response to: Mark Williams in response to: Mark Williams
Found a solution:

ShowWindow(popup.handle, SWSHOWNOACTIVATE);
popup.visible:=true;

I had previously tried setting the popupform's visible property before calling ShowWindow, but that had activated the popupwindow. Setting it after doesn't for some reason.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Pop up form not painting  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 12, 2018 12:27 PM   in response to: Mark Williams in response to: Mark Williams
Mark Williams wrote:

If I call the form with a simple show command, it paints fully.
However, the calling form is deactivated and the popup form
activated, which I would like to avoid.

I have tried showing the form using ShowWindow and SetWindowPos with
no activation flag set in each case.

Have you tried overriding the virtual CreateParams() method to enable
the WS_EX_NOACTIVATE extended window style?

This shows the form and paints the top label, but doesn't paint the
panel and its child components.

Then you are probably not using those functions correctly. Please show
your actual code. Have you tried calling RedrawWindow() or
UpdateWindow() after showing the window? Or the Form's own
Invalidate() or Update() methods?

--
Remy Lebeau (TeamB)
Mark Williams

Posts: 120
Registered: 5/8/10
Re: Pop up form not painting  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2018 1:11 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...

Then you are probably not using those functions correctly. Please show
your actual code. Have you tried calling RedrawWindow() or
UpdateWindow() after showing the window? Or the Form's own
Invalidate() or Update() methods?

As mentioned in my last post, ShowWindow followed by setting the form's visible property to true works perfectly.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02