TLabel with Align=alClient causes Form to misbahave

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35481
    ralfiii
    Participant

    Unfortunately this time I didn't manage to create a small demo-application that only uses standard controls.

    Im my case this error occurs on docked forms using the LMD Docking pack that are created and placed dynamically. And it seems to only occur on Windows 7, not on XP.

    The form only holds a TMemo (a TPanel, TGrid… all of them work for this problem) and a TLabel. Here the dfm-code:

    Code:
    object lbProgress: TsLabel
    Left = 0
    Top = 41
    Width = 342
    Height = 117
    Align = alClient
    Alignment = taCenter
    Caption = 'Analysis in progress…'
    Layout = tlCenter
    end
    object Memo1: TMemo
    Left = 0
    Top = 0
    Width = 342
    Height = 41
    Align = alTop
    end

    So, important: The TLabel has Align=alClient. (This seem to cause the problem)

    When the form is created and shown (see image 01_Skinned_fail.PNG), all the elements in the form don't adjust to the new size, they show in the size they originally had in the IDE.

    When I slightly resize the form everything suddenly works (see 02_Skinned_AfterResize.PNG)

    When I deactivate skinning then the problem doesn't occur at all (see 03_Unskinned.PNG)

    When I replace TLabel with TsLabel the problem is also gone.

    However, this is an issue that should be addressed.

    Ralf

    #49496
    Support
    Keymaster

    When you activates a skin? In the form OnShow/OnCreate or in design-time?

    #49497
    ralfiii
    Participant
    'Support' wrote:

    When you activates a skin? In the form OnShow/OnCreate or in design-time?

    In OnCreate.

    #49498
    Support
    Keymaster

    TsSkinProvider is placed already to the form?

    #49510
    ralfiii
    Participant
    'Support' wrote:

    TsSkinProvider is placed already to the form?

    No, that solves the problem.

    Is there an explanation available what the SkinProvider does? Most of the times I don't need it but sometimes I do, confusing….

    However, the other issue

    http://www.alphaskins.com/forum/index.php?showtopic=7333&view=findpost&p=40423

    is MUCH more serious, this one was solvable using TsLabel, for the other one I haven't found anything yet.

    #49585
    Support
    Keymaster

    TsSkinProvider needed for a skinning of form.

    Usually this component is created automatically when form is shown.

    But in some cases we can't control some events which occurs before automatic TsSkinProvider creation.

    I suggest always use TsSkinProvider in design-time because forms behaviour will be better when this component was defined in design-time.

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