Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I don't know if it's a bug... But when I set any other VCL style except for "Windows", the window width is reduced.

-

Is there any solution for this?

UPDATE I submitted this to QC: http://qc.embarcadero.com/wc/qcmain.aspx?d=103697 Hope they'll fix it...

share|improve this question
add comment

3 Answers

This is not a vcl styles bug, This is how the vcl styles works, each style(skin) has a own border width and height, which sometimes doesn't match with the native windows border size.

check the next images

the carbon style has a border width and height of 5 pixels

the Amakrits style has a border width and height of 6 pixels

You can check the border style size of each style using the VCL Styles Designer

  • Objects -> Form- > Image -> LeftBorder -> Width
  • Objects -> Form- > Image -> RigthBorder -> Width
  • Objects -> Form- > Image -> BottomBorder -> Height

So, depending of the above properties the Style hook of the form recalculates the bounds of the Client area.

share|improve this answer
show 1 more comment

It does indeed appear to be a VCL bug. The ClientWidth property is not properly streamed from the .dfm file when the style is set in the project options to be other than the system style.

I suggest that you submit a report to QualityCentral. In the meantime you may be able to work around this by setting the style in the .dpr file after the forms have been created.

Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TMainForm, MainForm);
TStyleManager.SetStyle('Amakrits');//after CreateForm, rather than before
Application.Run;

However, I don't imagine that will get you very far because you probably want to be able to create forms on the fly and not have to create the all upon startup.

share|improve this answer
show 1 more comment

No XE2 here, but this sounds very familiar. Try setting AutoScroll to True (strangely, the opposite of this answer) to store the client form size rather then the border size.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2014 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc by-sa 3.0</a> \r\n                with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2014.4.24.1564\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Stack Overflow works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </nos"], "copyright__copyright__copyright": ["nd not have to create the all upon startup.\n\nshare|improve this answer\nshow 1 more comment\n\nNo XE2 here, but this sounds very familiar. Try setting AutoScroll to True (strangely, the opposite of this answer) to store the client form size rather then the border size.\n\nshare|improve this answer\nadd comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}