Autor Beitrag
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 26.04.07 07:52 
Ich habe ein Statusbar mit ein paar TStatusPanel daruf. Nun hätte ich gern, dass bei jedem StatusPanel ein eigener Hint angezeigt wird. Muss ich dies nun mühsam über OnMouseMove und ausrechnen lassen oder gibt es eine einfachere Möglichkeit?

Link zu DSDT

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
iKilledKenny
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 394
Erhaltene Danke: 8

Win XP
D5 Prof, C# Express 2005
BeitragVerfasst: Do 26.04.07 08:02 
Ich mach es immer im MouseMove und kenne keine andere Möglichkeit.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 28.04.07 07:59 
Hallo

ich würde es so lösen (Sb_getrect verwenden):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
procedure TForm1.StatusBar1MouseMove(Sender: TObject; Shift: TShiftState;
  X, Y: Integer);
//uses commctrl
Var i:integer;
    PanelRect: TRect;
    NeuerHint:string;
begin
  for i:=0 to StatusBar1.Panels.Count-1 do
    begin
      SendMessage(StatusBar1.Handle, SB_GETRECT, I, Integer(@PanelRect));
      if PtInRect(PanelRect,point(x,y)) then
        begin
          NeuerHint:='Hint vom Panel '+inttostr(i);
          if NeuerHint<>StatusBar1.Hint then
            begin
              StatusBar1.Hint:=NeuerHint;
              Application.CancelHint;
            end;
          break;
        end;
    end;
end;


Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)