Recent

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

TomTom

  • Full Member
  • ***
  • Posts: 109
[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

  • Full Member
  • ***
  • Posts: 149
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.
Lazarus 2.0 / FPC 3.0.4 / Windows 8.1 64-bit

TomTom

  • Full Member
  • ***
  • Posts: 109
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 :)