Einzelnen Beitrag anzeigen

Alaitoc

Registriert seit: 24. Okt 2008
263 Beiträge
 
Delphi 7 Enterprise
 
#18

Re: [XP-Manifest] Rahmen eines Buttons

  Alt 27. Okt 2009, 16:37
So habs jetzt einfach mal so gemacht:

Delphi-Quellcode:

{ TThemesSpeedButton }

//******************************************************************************
//* Paint
//******************************************************************************

procedure TThemesSpeedButton.Paint;
var
  coDetails: TThemedElementDetails;
  coThemeStyle: TThemedComboBox;
begin
  if ( ThemeServices.ThemesEnabled ) and not (csDesigning in ComponentState) then
  begin
    if Enabled then
    begin
      if (Down) or (FState = bsDown) then
      begin
        coThemeStyle := tcDropDownButtonPressed;
      end
      else
      begin
        if MouseInControl then
          coThemeStyle := tcDropDownButtonHot
        else
          coThemeStyle := tcDropDownButtonNormal;
      end;
    end
    else
    begin
      coThemeStyle := tcDropDownButtonDisabled;
    end;
    coDetails := ThemeServices.GetElementDetails(coThemeStyle);
    ThemeServices.DrawElement(Canvas.Handle, coDetails, ClientRect);
  end
  else
  begin
    inherited;
  end;
end;
  Mit Zitat antworten Zitat