close TsTabSheet and stop ac TsSpeedButton it is possible?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #68472
    Rafał Drzewiecki
    Participant

    I create a TabSheet with Frame and later I try close TabSheet from Button on Frame.

    
    TabSheet := TsTabSheet.Create(APageControl);
    TabSheet.PageControl := APageControl;
    Frame := TFrame.Create(TabSheet);
    SkinManager.UpdateScale(Frame);
    Frame.Parent := TabSheet;
    APageControl.ActivePage := TabSheet;

    Code in Frame:

    procedure TFrame_Test.sSpeedButton2Click(Sender: TObject);
    begin
      if Parent.ClassName = 'TsTabSheet' then
        TsPageControl(Parent.Parent).Pages[TsTabSheet(Parent).PageIndex].Free;
    end;

    TabSheet is closing but i get AV in this line code:

    unit sSpeedButton;
    
    procedure TsSpeedButton.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
      if [csDesigning, csDestroying] * ComponentState = [] then begin
        Application.ShowHint := AppShowHint;
        ShowHintStored := False;
        if (Button = mbLeft) and Enabled and (ButtonStyle = tbsDropDown) then begin
          DroppedDown := False;
          TempControl := nil;
        end;
        inherited;
    ->    if (FCommonData.PulsTimer <> nil) and FCommonData.PulsTimer.Enabled then
          FCommonData.PulsTimer.PrepareImage;
    //    RestartAttention(SkinData);
      end;
    end;

    AV because FCommonData = nil

    Do you have any way to do it?

    #68491
    sergunalpha
    Keymaster

    Hello RafaƂ!
    This issue will be solved in the nearest release, I think.
    Thank you for the message.

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