1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to enas[email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram

  5. Delphifan Magazine
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

Makinga Form Non-Moveable

Discussion in 'Delphi Programming' started by AdminDF, Jan 3, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan Staff Member DF Staff

    {
    Here is how to keep the window from moving:


    First, make the borderstyle something like bsDialog, so that the window cant be
    resized.


    Next, add the following declaration to your form class:
    }
    Code:
    procedure PosChange(var Msg: TWmWindowPosChanging);
      message WM_WINDOWPOSCHANGING;
    
    
    //Finally, implement the procedure like:
    
    
    procedure TForm1.PosChange
      (var Msg: TWmWindowPosChanging);
    begin
       Msg.WindowPos.x := Left;
       Msg.WindowPos.y := Top;
       Msg.Result := 0;
    end;
    
    {
    Thats it. Easy as can be. The only problem with this is that you cant move the
    form if you want your code to. To get around this, just set up a Boolean variable
    called PosLocked, set it to True when you want to HIDE-THANKS the forms position,
    and to false when you need to move the form (when your done, remember to set it
    back to true). Then to implement the proc above, just make it
    }


    Code:
    if PosLocked then begin
       Msg.WindowPos.x := Left;
       Msg.WindowPos.y := Top;
       Msg.Result := 0;
    end else inherited;
     

Share This Page