How to make the MainForm unmoveable?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36879
    Nikola
    Participant

    Hi to everybody.

    I've tried all solutions, described at

    http://delphidabbler.com/tips/187

    They all don't work with AlphaControls. If you have any more ideas, share them with me, please.

    #54754
    Support
    Keymaster

    Hello, Nikola

    First solution must work:

    Code:
    procedure PosChange(var Msg: TWmWindowPosChanging); message WM_WINDOWPOSCHANGING;

    procedure TForm1.PosChange(var Msg: TWmWindowPosChanging);
    begin
    Msg.WindowPos.x := Left;
    Msg.WindowPos.y := Top;
    Msg.Result := 0;
    end;

    Can you show an example where it's not working, please?

    #54817
    Nikola
    Participant
    'Support' wrote:

    Hello, Nikola

    First solution must work:

    Code:
    procedure PosChange(var Msg: TWmWindowPosChanging); message WM_WINDOWPOSCHANGING;

    procedure TForm1.PosChange(var Msg: TWmWindowPosChanging);
    begin
    Msg.WindowPos.x := Left;
    Msg.WindowPos.y := Top;
    Msg.Result := 0;
    end;

    Can you show an example where it's not working, please?

    I've tried three times more, unfortunately, this solution does not work. Please, check it with the example attached.

    [attachment=7614:alphacontrol_demo.zip]

    #54828
    Support
    Keymaster

    Thank you for the demo. You should add “message WM_WINDOWPOSCHANGING;” there, as in the sample code.

    Also, disable the “Blend a form when moved” feature and solution will work then as expected.

    #54842
    Nikola
    Participant
    'Support' wrote:

    Thank you for the demo. You should add “message WM_WINDOWPOSCHANGING;” there, as in the sample code.

    Also, disable the “Blend a form when moved” feature and solution will work then as expected.

    If the feature is disabled, setting of Align property to alCustom works as well.

    Thank you very much for your help. I appreciate AlphaControl – it`s really a cool stuff.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.