Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

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

  • 3 Comments sorted by Votes Date Added
  • 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.
  • edited December 2023 Posts: 22Vote Up0Vote Down
    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;
Sign In or Register to comment.