Enabling disabled TsFrameBar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #35075
    dyferencjal
    Participant

    Hi,

    i have two modes of my delphi forms – EDIT and READONLY. In READONLY i set .Enabled = False to every component (apart from TPageControl) using such a loop:

    Code:
    procedure SetControls()
    var
    i : integer
    begin
    for i := 0 to Component.ControlCount – 1 do
    begin
    if (Component.Controls is TWinControl) then
    begin
    if not (Component.Controls is TPageControl) then
    (Component.Controls as TWinControl).Enabled := False;
    if (Component.Controls as TWinControl).ControlCount > 0 then
    SetControls(Component.Controls as TWinControl, False);
    end;
    end;
    end;

    Now i want also to enable the TsFrameBar so that items can be clicked, opened and viewed. I tried this , but thats not working:

    Code:
    if not (Component.Controls is TPageControl) or not (Component.Controls is TsFrameBar) or not (Component.Controls is TsTitleButton) then

    Also i tried this, but it does not compile:

    Code:
    if not (Component.Controls is TPageControl) or not (Component.Controls is TsFrameBar) or not (Component.Controls is TsTitleButton) or not (Component.Controls is TsTitleItem) or not (Component.Controls is TsTitles) then

    [Error] Tools.pas(122): Incompatible types: 'TsTitleItem' and 'TControl'

    [Error] Tools.pas(122): Incompatible types: 'TsTitles' and 'TControl'

    Any idea how to get this working?

    #47843
    JM-DG
    Participant

    If you could provide us with a little test application,

    I would be pleased to help you out.

    #47918
    Support
    Keymaster

    Hello!

    I think, you should operate with TsTitleItem.TitleButton property.

    This button is inherited from TsSpeedButton and all features are inherited too.

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