Autor Beitrag
|\/|_/\_><
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Do 13.10.05 13:40 
hi,
Wenn ich in einem RichEdit-Element Strg+R oder Strg+L drücke, dann wird der Text rechts- bzw. linksbündig. Kann ich das irgendwie unterdrücken?

Danke!

Gruß Max
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 13.10.05 13:55 
Hallo,

eine Möglichkeit:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;  
  Shift: TShiftState);  
begin  
  if ssCtrl in Shift then
    if (Chr(Key) = 'L') or ((Chr(Key) = 'R') then
      Key := $0;
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
|\/|_/\_>< Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Do 13.10.05 15:24 
Aber ein Attribut, was man setzen kann um alle solche Tastenkürzel zu deaktivieren gibt es nicht, oder?

Das hilft mir aber trotzdem schon mal weiter. - Danke!
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 13.10.05 16:13 
Hallo,

ein Attribut kenn ich nicht.

Alle Tastenkürzel die mit Strg kombiniert sind deaktivieren:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if ssCtrl in Shift then 
    Key := $0;
end;


Alles abschalten:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Shift <> [] then
    Key := $0;
end;

Der Code deaktiviert auch zum Beispiel markieren mittels Umschalttaste oder Großschreibung.
Aber das kannst Du ja Deinen Wünschen entsprechend anpassen.
Schau Dir dazu TShiftState in der Delphi-Hilfe an.

Ps.: :gruebel: Gibt es eigentlich eine Liste der vorhandenen Tastenkürzel des RichEdit?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )