Autor Beitrag
cromos
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Fr 16.01.04 21:24 
Hallo

ich möchte ein Kontextmenü anzeigen lassen, wenn der User mit der rechten Taste auf einen Eintrag klickt.

Wie mache ich das?
Sprich wie erzeuge ich das Menü und wie und in welchem Event binde ich das ein?

Gruss
Cromos
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: Fr 16.01.04 21:28 
Hallo,

ein Popupmenu auf die Form packen und entsprechend erstellen.
im Listview im Ereignis Oncontextpopup (OH-durchlesen!) rechtsklick abfangen , übergebene mauspos auswerten, evtl menu ändern und das menu mit popoupmenu.popup(...) zum Vorschein bringen.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Sa 17.01.04 13:25 
Hallo,

danke erst mal für die Antwort, habe aber jetzt trotzdem noch ein kleines
Problem damit:

Ich habe in dem von Dir angesprochenen Event das geschrieben:
ausblenden Delphi-Quelltext
1:
popupmenu1.Popup(Mouse.CursorPos.X,Mouse.CursorPos.X);					


Wenn ich jetzt die rechte Maustaste drücke erschein das Menü auch. Aber nicht da wo die Maus sich befindet.

Gruss
Cromos
Visum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 106



BeitragVerfasst: Sa 17.01.04 14:15 
In der Zeile, die du angeben hast ist noch ein kleiner Fehler drin, da du für beide koordinaten die x-koordinate der maus benutzt ;)
ausblenden Delphi-Quelltext
1:
popupmenu1.Popup(Mouse.CursorPos.X,Mouse.CursorPos.Y);					
cromos Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 219


Delphi 7
BeitragVerfasst: Sa 17.01.04 14:34 
:oops: :oops: :oops: :oops:
Peinlich,peinlich.

Hab ich gar nicht gesehn. Danke
Visum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 106



BeitragVerfasst: Sa 17.01.04 14:35 
standartfehler ;) sowas kommt vor ...
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 17.01.04 14:38 
Visum hat folgendes geschrieben:
standartfehler ;) sowas kommt vor ...

Standardfehler ;) sowas kommt auch vor ... ;)

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
Visum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 106



BeitragVerfasst: Sa 17.01.04 14:40 
sag ich doch ;)