Autor Beitrag
PP-deluxe
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 12.02.06 15:55 
Hallo,
ich bekomme es irgendwie nicht hin, ein einzelnes Statusbar-Panel (z.B. statusbar1.Panels[0]) zu färben oder ein Bild eiinzufügen.

Geht das überhaupt?

Was mach ich falsch?

ThX


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am Do 16.03.2006 um 10:02
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 12.02.06 16:27 
Um ein Icon in ein Panel der Statusbar einzufügen, musst du die Nachricht Suche im MSDN SB_SETICON ab die Statusbar schicken. Und mit Suche im MSDN SB_SETBKCOLOR kannst du die Hintergrundfarbe eines Panels setzen.
PP-deluxe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 12.02.06 16:40 
hä?

wenn ich das eingebe funktioniert das auch nicht, kannst du mir mal bitte den Code schicken?
ThX
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 12.02.06 16:41 
Wenn du WAs eingibst funktioniert das nicht?
PP-deluxe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 12.02.06 16:54 
Statusbar1.SB_SETBKCOLOR := clGreen;
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 12.02.06 16:59 
user profile iconLuckie hat folgendes geschrieben:
Um ein Icon in ein Panel der Statusbar einzufügen, musst du die Nachricht Suche im MSDN SB_SETICON ab die Statusbar schicken. Und mit Suche im MSDN SB_SETBKCOLOR kannst du die Hintergrundfarbe eines Panels setzen.

Bitte sorgfälltig lesen! Desweiteren sollte dir der Compiler bei deinem Code eine Fehlermeldung ausgeben.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
uses
  commctrl;

procedure TForm1.Button1Click(Sender: TObject);
var
  hIcon: THandle;
begin
  SendMessage(Statusbar1.Handle, SB_SETBKCOLOR, 0, RGB(255,0,0));
  hIcon := LoadImage(0'E:\Delphi\Sonstiges\MP.ico', IMAGE_ICON, 1616, LR_LOADFROMFILE);
  SendMessage(Statusbar1.Handle, SB_SETICON, 1, hIcon);
end;
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 12.02.06 17:00 
user profile iconPP-deluxe hat folgendes geschrieben:
Statusbar1.SB_SETBKCOLOR := clGreen;


Hallo,

ich kann dich zwar nicht direkt weiterbringen, aber diese Codezeile geht insofern nicht, weil SB_SETBBCOLOR keine Eigenschaft einer Statusbar ist. Das geht irgendwie mit Windows-Messages :nixweiss:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 12.02.06 17:01 
user profile iconKoller hat folgendes geschrieben:
user profile iconPP-deluxe hat folgendes geschrieben:
Statusbar1.SB_SETBKCOLOR := clGreen;


Hallo,

ich kann dich zwar nicht direkt weiterbringen, aber diese Codezeile geht insofern nicht, weil SB_SETBBCOLOR keine Eigenschaft einer Statusbar ist. Das geht irgendwie mit Windows-Messages :nixweiss:


//Edit: Luckie hat die Lösung :wink: - und ich war zu lahm

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
PP-deluxe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 12.02.06 17:11 
ok, vielen Dank

eine letzte Frage: Wie kann man das Panel 2 verstecken (Hide oder sowas) ??

Dann wär alles in Butter :)
ThX
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: So 12.02.06 17:14 
Panel2.visible:=false oder panel2.hide

Beides bewirkt das gleiche.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 12.02.06 19:30 
Bitte für eine neue Frage ein neues Topic eröffnen. Sonst gibt das zu viel Chaos, danke!

Gruß,
raziel

_________________
JSXGraph
PP-deluxe Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Mo 13.03.06 18:32 
so, eine letzte Frage noch ^^

wie bekommt man das ICON wieder weg?
Den Text bekommt man ja mit statusbar1.panels[1].text := ''; weg, aber das Icon ja nicht

ThX
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 13.03.06 19:14 
Über gib 0 anstatt ein Handle auf ein Icon.