2

I have a pagecontrol in the center of my main form (form1 in my image), and I want to open other forms docked into the pagecontrol. Because I have many controls on my child form, I need both vertical and horizontal scrollbars (on the child form I have active scrollbars option active), but here is the catch: when I use VCL Styles, my scrollbars aren't drawing as they should be and they are unusable. Is this some kind of a bug of VCL Styles?

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Cristian Vasuica
  • 369
  • 9
  • 22
  • I there are some bugs with scrollbars in new VCL Styles. – philnext Apr 24 '12 at 19:52
  • If you haven't already, you might want to vist [The Road to Delphi](http://theroadtodelphi.wordpress.com/), as there is a lot of information about VCL Styles there – Nicholas Ring Apr 24 '12 at 21:36
  • 2
    Can you provide a basic code to replicate the issue? – RRUZ Apr 25 '12 at 01:42
  • @RRUZ - Basic code for the problem: In 'OnCreate' of the form put `AutoScroll:=False;`, `VertScrollBar.Range:=Height*2;` The scrollbar shows only with 'Windows' theme. – Sertac Akyuz Apr 25 '12 at 08:19
  • so i will try yo explain in a few words: on my main form i have a button which triggers the creation of my child form(the one that i want to dock into the page control); this is the code that i wrote on TMainFormCreateButton.Click :`if not Assigned (Form2) then Form2:= TForm2.Create (Application);` `Form2.ManualDock(PageControl1);` `Form2.Show;` if i don`t have vcl styles enabled it all works fine, but with a vcl style active, the scrollbar om my child form doesn`t draw correctly :( – Cristian Vasuica Apr 25 '12 at 11:34

1 Answers1

3

The scrollbars (TControlScrollBar) used by the TForm doesn't support the Vcl Styles (you must report this to the QC page), if you want fix that you must override that control and paint the scrollbars using the Vcl styles methods, but that will requiere a lot of work, as simple workround you can use the TScrollBar component (in your form) which properly supports the vcl styles.

RRUZ
  • 134,889
  • 20
  • 356
  • 483
  • @Rodrigo: but if i use the method that you used at TWebBrowser project in your blog, it could work? i will give it a try and let you know ;) – Cristian Vasuica Apr 26 '12 at 07:22
  • 1
    I think I found a way, not very nice but it did work. On the child form I have placed a TScrollBox and set it`s Align Property= AllClient; and then in my TScrollBox i`ve added all my components that i am supposed to use; and at runtime scrolling works ;) – Cristian Vasuica Apr 26 '12 at 10:37