Results 1 to 10 of 10

Thread: "Snapped" form resize like in Delphi 7 Object Inspector

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Ok, found a way but after each "snap" it has some offset more and more.
    Make new project, drop a drawgrid to it, set its DefaultRowHeight to 64, DefaultColWidth to 64. No fixedcols or rows.
    Add this to private section of Form1:

    Code:
    procedure WMWindowPosChanging (var Msg: TWMWindowPosMsg); message WM_WINDOWPOSCHANGING;
    And this in implementation:

    Code:
    procedure TForm1.WMWindowPosChanging(var Msg: TWMWindowPosChanging);
    begin
        if (Msg.WindowPos^.flags and SWP_NOSIZE = 0) and ((Msg.WindowPos^.cx <> Width)
            or (Msg.WindowPos^.cy <> Height))
      then
            begin
              Msg.WindowPos^.cx:=(Msg.WindowPos^.cx div 70)*70;
          Msg.WindowPos^.cy:=(Msg.WindowPos^.cy div 70)*70;
            end;
    end;
    Resize the form..

    The less columns or rows then the bigger offset gets.
    Maybe scollbars and grid line width is making troubles here, dunno.

    Any ideas?

    EDIT: Found another solution:
    https://groups.google.com/forum/#!to...pi/39tMGvqXjog

    I used ValueListEditor and if i set the INC_SIZE to DefaultRowHeight of the ValueListEditor, then there is no offset problem.
    But it still shows the small portion of item below the current last visible row.
    If i change the INC_SIZE to smaller or bigger i get the offset bug right away after resizing.
    Last edited by hwnd; 08-09-2013 at 01:10 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •