Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 27.01.04 22:05 
Liebe Leser!

Ich möchte im einfachsten Fall auf ein DBGrid mit der rechten Maustaste klicken und es soll eine Meldung ausgegeben werden. Wie geht das??

Habe schon OnMouseDown probiert, geht aber nur beim Formular. Ich bekomme OnKeyDown für DBGrid nicht hin!

Wäre schön, wenn jemand dafür Code kennt, dann komme ich wohl allein weiter.

Vielen Dank im Voraus,
Detlef Annies aus Lübeck
Ken-san
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 78

WIN: XP, 2000 LINUX: SUSE
Pascal, Delphi 5 Prof, C, C++
BeitragVerfasst: Mi 28.01.04 10:13 
HI :D

Also wenn ich das richtig verstanden habe dann müsste es ungefair so funktionieren:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure GBGrid.TGBGridMouseDown(Sender: TObject; Button: TMouseButton;Shift: TShiftState; X, Y: Integer); 
begin
    if Shift = [ssRight,ssLeft] then ...    {beide Maustasten gedrückt }
    if Button = mbLeft then ...             {linke Maustaste gedrückt }
end;


Ich hoffe das Hilft dir weiter(könnten noch Fehler drin sein :?

Kenny

Moderiert von user profile iconPeter Lustig: Code- durch Delphi-Tags ersetzt

_________________
SNAFU: Same Normal All f*** Up
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 28.01.04 16:48 
Danke erstmal ken-san! Aber diese Möglichkeit habe ich schon probiert, sie geht nicht!! - Leider ist auch onclick und ondblclick schon belegt, es müsste schon der rechte Mausbutton sein, aber WIE????

Dank für weitere Hilfe!

D. Annies
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 28.01.04 16:50 
Hallo, Ken-san!

Bitte benutze demnächst die Delphi-Tags. Durch die Delphi-Tags wird der Code mit Syntax-Highlighting angezeigt und ist somit sehr viel übersichtlicher.

Viele Dank!
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
KidPaddle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 351

WinXP,Linux
D7 Prof, XE7
BeitragVerfasst: Mi 28.01.04 17:27 
Das sollte so gehen. Wenn nicht, wird der Mausevent für die rechte Maustaste abgefangen. Hast Du eventuell ein popup - Menu mit dem Formular oder Grid verbunden?

Gruß
KidPaddle
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 01.02.04 22:23 
Titel: dbgrid plus maus
Nein, habe ich nicht. Ich konnte mich aber inzwischen behelfen, indem ich den Code in onclick mit reingelegt habe.

Trotzdem vielen Dank!!

Gruß, D. Annies