[SOLVED] SynEdit resize text lazarus / 21-General ---------------------------------------------------------------------- Hansvb · 2023-05-29 17:38 Hi, I would like to resize the text in a TSynEdit with mouse scrolling. I have the following but it doesn't work well. If you reduce the size, the text suddenly becomes large again. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TFrmMain.SynEditJsonDataMouseWheelDown(Sender: TObject;  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);begin  if (ssCtrl in Shift) and Sender.InheritsFrom(TSynEdit) then begin    TSynEdit(Sender).Font.Size := TSynEdit(Sender).Font.Size - 1;    Handled := true;  end;end; procedure TFrmMain.SynEditJsonDataMouseWheelUp(Sender: TObject;  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);begin  if (ssCtrl in Shift) and Sender.InheritsFrom(TSynEdit) then begin    TSynEdit(Sender).Font.Size := TSynEdit(Sender).Font.Size + 1;  end;end; It is for Windows only. ---------------------------------------------------------------------- Martin_fr · 2023-05-29 18:00 Make sure you don't go through zero. Negative font sizes are valid values, and the font becomes larger. (IIRC pixels vs points). SynEdit already has zoom. add emCtrlWheelZoom to SynEdit.MouseOptions. ---------------------------------------------------------------------- Hansvb · 2023-06-03 13:42 Quoteadd emCtrlWheelZoom to SynEdit.MouseOptions.I had overlooked that option. Thanks, zoom now works fine.