Autor Beitrag
Kielemanscharo
Hält's aus hier
Beiträge: 3



BeitragVerfasst: So 07.08.05 16:05 
Moin,

kann mir jemand sagen wie ich einen Rechtsklick in ein Editfenster verhindere und das Windows Standart Popmenü nicht angezeit bekomme :?: will dadurch verhindern das jemand etwas in ein EditFeld hinein kopieren kann :!:

Danke
Gruß


Moderiert von user profile iconGausi: Topic aus Programmierwerkzeuge verschoben am So 07.08.2005 um 16:16
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 07.08.05 16:11 
Moinmoin! :welcome: im DF!!! :D

Setz' dir einfach ein komplett leeres TPopupMenu auf dein Formular und weise das dann deinem Edit in der Eigenschaft PopupMenu zu. ;)

PS.: Das verhindert aber noch kein STRG+C und STRG+V. ;)
Kielemanscharo Threadstarter
Hält's aus hier
Beiträge: 3



BeitragVerfasst: So 07.08.05 16:30 
mensch das ging aber schnell

funktioniert sehr gut. vielen dank

mit strg+c und strg+v habe ich schon hinbekommen.

manchmal kann delphi richtig simpel sein.

gruß
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 07.08.05 16:33 
user profile iconKielemanscharo hat folgendes geschrieben:
mit strg+c und strg+v habe ich schon hinbekommen.

Wie hast du's gelöst? Mir fällt nämlich im Moment nix besseres ein als was in OnKeyDown reinzuschreiben. Aber die ShowMessage stört irgendwie... :gruebel:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if Key = 17 then ShowMessage('Kein STRG erlaubt.');
end;
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: So 07.08.05 16:44 
Hi,
user profile iconWeBsPaCe hat folgendes geschrieben:
Aber die ShowMessage stört irgendwie... :gruebel:

dann mache doch eine leeranweisung dort hin:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if Key = 17 then ;
end;


// Edit: bzw da muss daoch ohnehin noch ein Key = 0 hin oder?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
if Key = 17 then Key = 0;
end;


Gruß
Klabautermann
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: So 07.08.05 16:46 
Wenn schon, dann muss es if Key = 17 then Key :0; heißen ;)

_________________
JSXGraph
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: So 07.08.05 16:48 
Autsch... :autsch: Ich dachte Key sei read-only. ;)
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: So 07.08.05 16:49 
user profile iconraziel hat folgendes geschrieben:
Wenn schon, dann muss es if Key = 17 then Key :0; heißen ;)


Jaja, ich hüpfe momentan zu viel zwischen den sprachen ;).
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: So 07.08.05 17:16 
user profile iconWeBsPaCe hat folgendes geschrieben:

Setz' dir einfach ein komplett leeres TPopupMenu auf dein Formular und weise das dann deinem Edit in der Eigenschaft PopupMenu zu. ;)

Es geht noch einfacher und ohne zusätzliche Komponente: mit dem OnContextpopup-Ereignis. Dort einfach
ausblenden Delphi-Quelltext
1:
  handled:=true;					

reinschreiben

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)