When Top = 0 Is Not 0

  • This topic has 2 replies, 2 voices, and was last updated 8 years ago by TAZ.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37118
    TAZ
    Participant

    Hello again. I have been plagued with this for a long time and feel like this needs an answer.

    Add a line of code to your demo.

    procedure TFrame_CurrentSkin.SliderExtBordersSliderChange(Sender: TObject);

    begin

    if not InInit then MainForm.sSpeedButton5Click(nil);

    MainForm.Top := 0; <<<< new line. end; Use AutumnSky because it has a solid border. Toggle Extended Borders slider.

    When Extended Borders is false, the main form is at the top of the screen (0). When Extended Borders is true, the main form is above the top of the screen (<0). It is like it ignores setting the top to 0.

    How can you set the top of the form when 0 is not 0? Is there a documented or undocumented way to read the top when you are using Extended Boarders which will allow you to adjust the value?

    Or is this a Windows inconsistency that we have to live with?

    #55478
    Support
    Keymaster

    ExtendedBorder is just additional painting, it's not the real Form1 area.

    You can use this code for a positioning of form with extended borders:

    Code:
    Form1.Top := 0 + DiffTitle(sSkinProvider1.BorderForm);
    Form1.Left := 0 + DiffBorder(sSkinProvider1.BorderForm);

    This code will work if ExtendedBorders is False also (results of functions will be 0).

    #55509
    TAZ
    Participant

    Works great. Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.