Announcement

Collapse
No announcement yet.

Width und Height vor/nach Skalieren mit Maus

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Width und Height vor/nach Skalieren mit Maus

    Hallo.

    Ich habe folgendes Problem. Ich brauche die Width und Height eines MDI-Child-Fensters (bzw. einer mit Align angeordneten Komponente) vor UND nach dem Skalieren mit der Maus (z.B. durch Klicken und Ziehen rechts unten am Fensterrand).

    Welches Ereignis bietet mir diese Werte zu welcher Zeit an?

    Grüße

    Lars

  • #2
    Für den Fall, dass es jemanden aus dem Forum interessiert, habe ich hier einen Lösungsansatz von Peter Below (TeamB):

    <pre>
    There is no event directly usable for this but it can be done with a
    bit of API mixed in. When the user starts to drag on the border the
    window gets a WM_ENTERSIZEMOVE message, when the mouse goes up again it
    gets a WM_EXITSIZEMOVE message. So these are ideally suited to record
    old and new size. Note that the messages (as their name implies) are
    also send when the user moves the window by dragging on the caption. In
    that case the two sizes will simply be equal, so that is easy to test.

    private
    FOldSize, FNewSize: TRect;

    Procedure WMEnterSizeMove( Var msg: TMessage );
    message WM_ENTERSIZEMOVE;
    Procedure WMExitSizeMove( Var msg: TMessage );
    message WM_EXITSIZEMOVE;

    Procedure TProdBuilderMainForm.WMEnterSizeMove( Var msg: TMessage );
    begin
    FOldSize := BoundsRect;
    end;

    Procedure TProdBuilderMainForm.WMExitSizeMove( Var msg: TMessage );
    begin
    FNewSize := BoundsRect;
    ... do something with the sizes
    end;

    </pre&gt

    Comment


    • #3
      Hi

      Funktioniert aber nicht unter Win95a, da diese Messages dort nicht existieren.

      Gruß Hage

      Comment

      Working...
      X