How to make the MainForm unmoveable?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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 4 posts - 1 through 4 (of 4 total)
          • You must be logged in to reply to this topic.