Recent

Author Topic: [SOLVED]How to change SynEdit ScrollBars property from code?  (Read 1894 times)

TomTom

  • Full Member
  • ***
  • Posts: 170
[SOLVED]How to change SynEdit ScrollBars property from code?
« on: January 03, 2019, 09:58:35 am »
Hi.
I'm writing simple text editor using SynEdit. I'm creating SynEdit instance from code (Add tab button which ... adds new tab with SynEdit ;) ), so I guess I need to set some properties (align, highlighter etc) from code also. I have problem with Scrollbars. I want them to be set to ssAutoBoth but this
Code: [Select]
//  PrimeEdit is TSynEdit; 
PrimeEdit.Scrollbars:=ssAutoBoth;
gives me an error. :]

How can I set this property from code?

« Last Edit: January 03, 2019, 12:55:30 pm by TomTom »

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: How to change SynEdit ScrollBars property from code?
« Reply #1 on: January 03, 2019, 12:24:52 pm »
I'm writing simple text editor using SynEdit. I'm creating SynEdit instance from code (Add tab button which ... adds new tab with SynEdit ;) ), so I guess I need to set some properties (align, highlighter etc) from code also. I have problem with Scrollbars. I want them to be set to ssAutoBoth but this
Code: [Select]
//  PrimeEdit is TSynEdit; 
PrimeEdit.Scrollbars:=ssAutoBoth;
gives me an error. :]
How can I set this property from code?

You should post the error message too.

In any case, TSynEdit.Scrollbars is a TScrollStyle property, which is in the unit StdCtrls.pas. Add it to your uses clause.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

TomTom

  • Full Member
  • ***
  • Posts: 170
Re: How to change SynEdit ScrollBars property from code?
« Reply #2 on: January 03, 2019, 12:55:15 pm »
Yes, that was the problem :). I had to add StdCtrls to uses clause :)
Thank You :)

 

TinyPortal © 2005-2018