Autor Beitrag
Stinger47
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 102



BeitragVerfasst: Mi 25.06.08 13:10 
Hi,
gibt es eine Möglichkeit einen BitButton rund zu machen?
Vielleicht irgendwie über RoundRect?

Grüße...:)
j.klugmann
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 25.06.08 13:14 
du kannst doch ein Shape nehmen.Kann man zum Button umformen. :wink:
Stinger47 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 102



BeitragVerfasst: Mi 25.06.08 13:26 
Ich lade Bilder und setze die dann auf BitButtons.
Nun wollte ich nur noch des Designs wegen Bild und somit auch BitButton rund haben...:)

Lässt sich das runde Bild dann einfach über Canvas auf das Shape zeichnen?

Bzw. gibt es nicht noch eine Möglichkeit die Knöpfe danach rund zu bekommen?
Boldar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Mi 25.06.08 14:56 
Irgendwo habe ich mal diesen Code gefunden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure ButtonStyle(aFrm: TForm);
var
  aRgn: hRgn;
  tmp : TComponent;
  i : integer;
begin
  for i:= aFrm.ComponentCount-1 downto 0 do
    begin
      if (aFrm.components[i] is TButton) then
        begin
          tmp:=aFrm.components[i];
          with TButton(tmp) do
            begin
              aRgn:= createRoundRectRgn(00, width, height, 2020);
              setWindowRgn(handle, aRgn, true);
            end;
        end;
    end;
end;



dass kan man z.B. so aufrufen:
ausblenden Delphi-Quelltext
1:
buttonstyle (self);					
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Mi 25.06.08 15:09 
wie wärs mit nem TXPManifest?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 25.06.08 15:46 
user profile iconFinnO hat folgendes geschrieben:
wie wärs mit nem TXPManifest?


Bringt dir unter W2K nix bzw. dann nicht, wenn er den Standardlook hat oder aber ein anderes Theme mit eckigen Button :P

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Boldar
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1555
Erhaltene Danke: 70

Win7 Enterprise 64bit, Win XP SP2
Turbo Delphi
BeitragVerfasst: Do 26.06.08 11:01 
user profile iconBoldar hat folgendes geschrieben:
Irgendwo habe ich mal diesen Code gefunden:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure ButtonStyle(aFrm: TForm);
var
  aRgn: hRgn;
  tmp : TComponent;
  i : integer;
begin
  for i:= aFrm.ComponentCount-1 downto 0 do
    begin
      if (aFrm.components[i] is TButton) then
        begin
          tmp:=aFrm.components[i];
          with TButton(tmp) do
            begin
              aRgn:= createRoundRectRgn(00, width, height, 2020);
              setWindowRgn(handle, aRgn, true);
            end;
        end;
    end;
end;



dass kan man z.B. so aufrufen:
ausblenden Delphi-Quelltext
1:
buttonstyle (self);					

Das muss man Natürlich auf tbitbtn umformen, dass heisst Tbitbtn statt Tbutton schreibenh. Bei mir Funktioniert dass jedoch gut.