Autor Beitrag
MisterBum83
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 245
Erhaltene Danke: 2

WIN XP
Delphi 6
BeitragVerfasst: Di 19.07.05 11:09 
Hallo,
ich möchte 3 Toolbuttons machen wie in Word für Fett, Kursiv und Unterstrichen.
Nun meine Frage: Wie schaffe ich es, das die Button eingedrückt sind und in diesem Zustand bleiben, bis der Benutzer wieder drauf klickt?

Vielen Dank für eure Hilfe...
MisterBum
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 19.07.05 11:39 
Du musst die Eigenschaft AllowAllUp auf true setzen für die Button-Gruppe.
Und der Style muss tbsCheck sein.

Theoretisch sollte es dann funktionieren.
MisterBum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 107



BeitragVerfasst: Di 19.07.05 13:58 
Leider funzt das nicht.
Hier mein Quellcode:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
if ToolButton20.Down then
    CurrText.Style := CurrText.Style + [fsBold]
  else
    CurrText.Style := CurrText.Style - [fsBold];


Die Eigenschaft AllAlowUp ist auf true und bei Style ist tbsCheck eingestellt. Wenn beim OnClick-Erreignis der obige Quellcode aufgerufen wird, passiert nix. Weder der Text Fett gemacht, noch der Button ist eingedrückt...

Moderiert von user profile iconmatze: Code- durch Delphi-Tags ersetzt.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 19.07.05 14:22 
Wenn ich dir jetzt schreibe, dass das bei mir funktioniert, nützt dir das wohl auch nicht viel.
Ich habe das sogar jetzt getestet. AllowAllUp muss nichtmal gesetzt sein.

Setzt du die Button evtl. noch im Programm irgendwie?
MisterBum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 107



BeitragVerfasst: Di 19.07.05 14:36 
Jetzt weiss ich woran es liegt. Ich habe den Befehl

ausblenden Delphi-Quelltext
1:
{$R WinXPStyle.res}					


eingebunden, damit der WindowsXP-Stil zum vorschein kommt. Ohne das funzt es. Was könnte ich da machen, wenn ich den XP-Stil behalten will?