This forum is temporaily read-only. All existing discussions remain available for reference. For new questions, bug reports or support requests, please contact us at mail@lmdsupport.com.

LMD RichPack

Zoom property does not work! Unable to zoom in on text box.

Value: -64..64??? Why are the values ​​not in percentage %

The PageMagins (Bottom, Top) property is not supported.
it does not work.

how to resolve this problem?

THANKS

Comments

  • edited December 2023
    The solution to zoom the text box :

    { GetZoom }
    function GetZoom: Integer;
    var
      wp, lp: integer;
    begin
       Result := 100;
       SendMessage( LMDRichedit.Handle, EM_GETZOOM, Integer( @wp ), Integer( @lp ) );
       if ( lp > 0 ) then
          Result := MulDiv(100, wp, lp);
    end;

    { SetZoom }
    procedure SetZoom(const LMDRichEdit: TLMDCustomRichEdit;
      const Value: Integer);
    const
      EM_SETZOOM = (WM_USER + 225);
    begin
      SendMessage(LMDRichEdit.Handle, EM_SETZOOM, Value, 100);
    end;

    { ZoomIn Click }
    procedure TFxxxx.ZoomInClick(Sender: TObject);
    var
      Zoom: Integer;
    begin
      Zoom := GetZoom;

      if Zoom < 200 then
        Inc(Zoom, 10); // Inc Zoom +10%

      SetZoom(LMDRichEdit, Zoom);
    end;
  • Zoom property works in according to Microsoft's documentation: "Sets the zoom ratio for a multiline edit control or a rich edit control. The ratio must be a value between 1/64 and 64". Zoom vaues -1, +1 and 0 - are actually the same zoom.

    PageMagins (Bottom, Top) issue - confirmed, fixed.
Sign In or Register to comment.