?
Solved

Detecting when a form is restored to original size

Posted on 2002-06-22
4
Medium Priority
?
174 Views
Last Modified: 2010-04-04
Hi,

I have a number of forms that dynamicly resize panes etcetera when resized. This works fine when the user maximizes the window, but when the window is restored to its previous size, the onresize event doesn't seem to be invoked, so my panels are screwed up.

Any suggestions?

Leo aKa Oneeye
0
Comment
Question by:oneeye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
TOndrej earned 400 total points
ID: 7101443
You can watch for WM_SYSCOMMAND message with SC_RESTORE parameter:

type
  TForm1 = class(TForm)
  private
    procedure WMSysCommand(var Message: TWMSysCommand); message WM_SYSCOMMAND;
  end;

procedure TForm1.WMSysCommand(var Message: TWMSysCommand);
begin
  inherited;
  with Message do
    case CmdType and $FFF0 of
      SC_MINIMIZE:
        ShowMessage('minimized');
      SC_MAXIMIZE:
        ShowMessage('maximized');
      SC_RESTORE:
        ShowMessage('restored'); // your panel resizing code here
    end;
end;

HTH
TOndrej
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7101526
oneeye how about Anchors property ? :)
0
 

Author Comment

by:oneeye
ID: 7101763
Oddly enough, Lee, the bottom panel (where two buttons live) are anchored left, right, and bottom, but it still disappears when the size is restored.

I'll give TOndrej's code a whirl, thanks.
0
 

Author Comment

by:oneeye
ID: 7101783
Ah, Excellent. I do wonder why restoring doesn't invoke the resize method consistently, though.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question