Recent

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

TomTom

  • New member
  • *
  • Posts: 48
[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 »
NOTE! To other newbies (JUST LIKE ME! )
Study hard at all times. Read source codes, wikis and use search on forum/google. You will LOVE that feeling of satisfaction when You get Your things done without asking on forum :)
I've just made  prototype of game :D

dsiders

  • Full Member
  • ***
  • Posts: 112
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 1.8.2 / FPC 3.0.4 / Windows 8.1 64-bit

TomTom

  • New member
  • *
  • Posts: 48
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 :)
NOTE! To other newbies (JUST LIKE ME! )
Study hard at all times. Read source codes, wikis and use search on forum/google. You will LOVE that feeling of satisfaction when You get Your things done without asking on forum :)
I've just made  prototype of game :D