Autor Beitrag
jonathanschmid
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 11.02.06 14:59 
Hallo!
Ich hab da mal ne Frage:
Rechtsklick hat ja den virtuellen Tastencode (sie hier) 02. Und normalerweise müsste das ja dann mit
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
  begin
  if Key=Chr(02) then ShowMessage('Bitte kein Rechtsklick')
  end;

erkennen lassen können. Nur ist der Rechtsklick nicht in KeyPress einbezogen. Jetzt könnte man auf die Idee kommen das bei MouseDown reinzumachen... Nur hat ja MouseDown kein Parameter Key. Wie macht man das dann?
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: Sa 11.02.06 15:04 
MouseDown hat aber den Parameter Button ;-)

_________________
We are, we were and will not be.
jonathanschmid
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 11.02.06 15:27 
Sorry... bin noch nicht wirlich weit mit Delphi... en ziemlicher Anfänger! Könntest du vielleicht ein Quelltext schrieben :D
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: Sa 11.02.06 15:32 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Button = mbRight then showmessage('Rechte Maustaste gedrückt')
end;

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

winXP, win98, winME, debian, suse, maCoS, Symbian, WinCE
Delphi 7, Delhi 2006, c++, MySql, db2, php, js, java, c#, assembler,
BeitragVerfasst: Sa 11.02.06 15:34 
Hallo,

hab gerade das gleiche problem.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
 if Button=chr(02) then
  ShowMessage('Bitte kein Rechtsklick')
end;


Fehler:
"[Error] Unit1.pas(30): Incompatible types"

Was muss ich anstatt das "chr" hinschreiben. Ich versteh das nicht ganz.. :?

[EDIT] WArst schneller.. DANKE!!!

[EDIT2] Aber jetzt nochmal ne Fragen zu deiner Antwort:
Woher weißt du das es "mbRight" heißt und nicht "02", "VK_RBUTTON" oder sowas??
danke :lol:

Gruss,
MArc
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: Sa 11.02.06 15:40 
Sowas erfährt man, wenn man z.B. mit dem Textcursor in das TMouseButton reingeht, und dann F1 drückt ;-)

_________________
We are, we were and will not be.
jonathanschmid
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 11.02.06 15:42 
Hatte das auch so wie Trunks probiert un hatte dann das gleiche Problem... Hatte dann die gleiche Frage an dich... TMouseButton?? Sorry wenn ich so dumm frage... Tut mir ja echt leid, aber was soll ich machen? Naja...