Autor Beitrag
Hendi48
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mo 02.07.07 12:38 
Hi,
weiß jemand wie ich ein Panel sichtbar machen kann wenn die mouse drauf ist?
Andersrum krieg ich es hin mit onmousemove und dann halt panel1.visible:=false; aber wenn das panel noch gar nicht sichtbar ist und ich es sichtbar machen möchte geht das nicht.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mo 02.07.07 12:40 
Moin!

Schlicht - gar nicht. Unsichtbare VCLs kriegen keine Nachrichten. :|

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mo 02.07.07 12:43 
oh..schade :( kann ich es nicht irgendwie machen das wenn die maus an der stelle ist wo das panel ist (die koordinaten sind ja fest) das das dann visible wird?
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mo 02.07.07 12:53 
Ja!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
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: Mo 02.07.07 12:53 
Genau das wollt ich vorschlagen..
prüf einfach im OnMouseMove der Form bzw. des Objektes in/auf dem das Panel liegt, ob sich die Maus in eben diesen gültigen Koordinaten befindet.

LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mo 02.07.07 13:21 
ich hab das jetz so ins FormMouseMove getan aber es geht nicht: :(
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
MausPos: TPoint;
MouseX, MouseY: Integer;
begin
GetCursorPos(MausPos);
MouseX := MausPos.x;
MouseY := MausPos.y;
if (mouseX > 151) and (MouseX < 338) and (MouseY > 8) and (MouseY < 50) then
begin
panel1.Visible:=true;
end;
end;
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 02.07.07 13:27 
Lass mal das ganze MausPos-Gedrösel weg und nimm stattdessen die Parameter X und Y, die bei MouseMove mitgegeben werden. Wahrscheinlich kommen bei dir Bildschirmkoordinaten und Formkoordinaten durcheinander.

_________________
We are, we were and will not be.
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mo 02.07.07 13:29 
so gehts auch nicht...
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm2.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
if (X > 151) and (X < 338) and (Y > 8) and (Y < 50) then
begin
panel1.Visible:=true;
end;
end;
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 02.07.07 13:39 
Hab das grade mit leicht anderem Code ausprobiert, und es geht.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
panel1.Visible := (X > Panel1.Left) and 
                  (X < Panel1.Left + Panel1.Width) and 
                  (Y > Panel1.Top) and 
                  (Y < Panel1.Top + Panel1.Height);

_________________
We are, we were and will not be.
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Mo 02.07.07 13:43 
if PtInRect(Point(X, Y), PanelX.BoundsRect) then bla; wäre vermtl einfacher ;)


Vorausetzung für das ganze gedönst ist allerdings, das nichts unter dem Panel ist... sonst geht die Message nämlich nich an die Form, sondern an das entsprechende TWinControlbla.

gruss

_________________
erare humanum est
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mo 02.07.07 13:50 
das beides geht auch nich..unter meinem panel is noch ein image
Robinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 275

WinXP
BDS 2006
BeitragVerfasst: Mo 02.07.07 13:52 
Dann mal kurz den Kopf anschmeissen und du hast die Lösung ;) (Tip: das Image hat auch nen OnMouseMove)

_________________
erare humanum est
Hendi48 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271



BeitragVerfasst: Mo 02.07.07 13:56 
oh ich wusste nich das ich das von dem image auch nehmen kann ^^"
Ahh jetz gehts endlich. Danke für die Hilfe!