Autor Beitrag
Alpha_Wolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Mo 27.02.06 10:11 
Hallo EE,

ich habe einen Hint auf einen Button gesetzt.. nun möchte ich aber das der Hint auch dann angezeigt wird wenn man auf diesen klickt.

Mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.BtnInfoClick(Sender: TObject);
begin
  Application.HintPause := 0;
end;

funktionierts zwar das der Hint sofort gezeigt wird allerdings werden dann alle Hints sofort angezeigt wenn man über die jeweilige Komponente fährt..

Danke
Stefan

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Mo 27.02.06 12:20 
Hallo,

selber den Hint erstellen,
THintWindow ist das Stichwort.
Ein kleines Beispiel zum ausbauen:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
  private
    { Private-Deklarationen }
    HintWnd: THintWindow;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  HintWnd := THintWindow.Create(Self);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShowMessage('Befehl wurde ausgeführt');
end;

procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var aPoint : TPoint;
begin
  GetCursorPos(aPoint);
  HintWnd.ActivateHint(Rect(aPoint.X,aPoint.Y,aPoint.X+100,aPoint.Y+100),'Ein Buttonclick-Hint');
end;

procedure TForm1.Button1MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  HintWnd.ReleaseHandle;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  HintWnd.Free;
end;

Mit CalcHintRect kann man die erforderliche Größe des Hints berechnen.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Alpha_Wolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 297

Ubuntu, Win XP, Win Vista
C#, Delphi 6 Prof, Delphi 2007 Prof, Java
BeitragVerfasst: Mo 27.02.06 13:28 
Dankeschön Lannes für die Antwort.

Nur ich seh grad das da noch zuviel eigeninitiative nötig wäre damit das annehmbar funktioniert..;) Aber ich kanns auf alle Fälle für was anderes brauchen!!!

Stefan

_________________
Diskutiere nie mit einem Irren - er zieht dich auf sein Niveau und schlägt dich mit seiner Erfahrung.