Solved

Quuestion for Viktornet -Forms in different rsolutions

Posted on 1998-10-26
4
177 Views
Last Modified: 2010-04-06
Dear Viktornet
I have awarded the points the previous question to boris.
I am asking this question just to award the points to you.
Please answer the question so that i could award the points to you
Regards
venks
ps- I was a little busy and hence not tried out the new code.
I will do it in a day or two and come back
0
Comment
Question by:venks
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:venks
ID: 1344396
Dear Viktor
I tried out the code and it works perfectly
Please answer soon so that i can award points
regards
venks
0
 
LVL 10

Accepted Solution

by:
viktornet earned 20 total points
ID: 1344397
Thanks Venks!

btw- I didn't receive the code you sent me. I'm wondering why is that. o O

Cheers,
Viktor
0
 
LVL 1

Author Comment

by:venks
ID: 1344398
Dear viktor
The code is as follows


unit Scaler;

     interface

     uses
       Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     Dialogs;
     const
        ScreenWidth  : Integer = 800; //If you don't want to declare constants
     //you'd have to have a
        ScreenHeight : Integer = 600;//property for each of these two so you can
    // declare it at //designtime
     type
       TScaler = class(TComponent)
       private
         FAllScaled : Boolean;
       protected
         { Protected declarations }
       public
         constructor Create(AOwner : TComponent);override;
         procedure Loaded;override;
       published
         { Published declarations }
       end;
     procedure Register;
     implementation
constructor TScaler.Create(AOwner : TComponent);
begin
  Inherited Create(AOwner);
  fAllScaled := False;
end;
procedure TScaler.Loaded;
begin
  Inherited;
  if not(csDesigning in ComponentState) then
    if Owner is TForm then
    with TForm(Owner) do begin
      Font.Pitch := fpVariable;
      if (not fAllScaled)and((Screen.Width<>ScreenWidth)or(Screen.Height<>ScreenHeight))then
       begin
         Scaled := True;
         AutoScroll := False;
          if Screen.Width < ScreenWidth then
         ScaleBy(Screen.Width, ScreenWidth)
         else ScaleBy(ScreenWidth, Screen.Width);
         fAllScaled := True;
       end;
     end;
end;
procedure Register;
begin
  RegisterComponents('System', [TScaler]);
end;
end.

Once again
Thanks
venks

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1344399
Thanks,...

btw- I got the mail from you.... Once again 10x
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now