Autor Beitrag
TheBlackRave
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Mo 10.03.03 22:24 
Brauch Hilfe wegen Memo!

Was bedeutet Memo.Enabled??? Ich möchte das Memo einfach sperren für eigen Bearbeitung. Also ist für Chat und man sollte den Inhalt nicht selber ändern könn danke.

Noch was wegen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
If Key=#13 Then
           Begin
           If ServerStatus Then
                           Begin
                           ClientSocket1.Socket.SendText(NickName+': '+Edit1.Text);
                           Edit1.Clear;
                           End
                           Else
                           Begin
                           Memo1.Lines.Add('Fehler *Sie sind mit keinem Server verbunden!');
                           Edit1.Clear;                           
                           End;
           End;
end;

Wenn man Enter drückt soll die Naricht abgeschickt werden. Da gab es auch OnEnter. Für was ist das?

Danke!

Moderiert von user profile iconTino: Titel geändert.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mo 10.03.03 22:28 
onenter ist das ereignis, wenn du das objekt wieder aktivierst.


sperren geht so <object>.enable := false;
mars
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 238

Debian Woody, Win 2000, Win XP
D7 Ent, Kylix 3
BeitragVerfasst: Mo 10.03.03 22:29 
OnEnter wird ausgelöst, wenn der User in das Feld hineinclickt oder tabbt, also wenn es den Fokus erhält.
Um das Memo für User unveränderbar zu machen, reicht es die Memo-Eigenschaft ReadOnly auf true zu setzen.

Gruss
TheBlackRave Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Mo 10.03.03 22:29 
torstenheinze hat folgendes geschrieben:
onenter ist das ereignis, wenn du das objekt wieder aktivierst.


sperren geht so <object>.enable := false;


Was ist onEnter?? Hää?
Gibt es keine Aktion, dass er reagiet wenn Enter eingegeben wird?
Ich möchte das Objekt nich sperren sonder es soll normal laufen.
Also Memo nur man soll den Inhalt nicht verändern können.
Danke! 8)
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mo 10.03.03 22:30 
mars hatts geschrieben.

jetzt hab ich auch verstanden, was du gemeint hast.
TheBlackRave Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Mo 10.03.03 22:32 
Danke! Also ich möchte, dass er ein Text verschickt wenn ich Enter drück.
Ich hab das Problem zur Zeit so gelöstet.
Gibt es keine bessere Möglichkeit?
Danke! :D
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mo 10.03.03 22:33 
funktioniert doch noch normal...
alternativ:
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
key:=#0;
end;
TheBlackRave Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Mo 10.03.03 22:34 
Fiji-Fighter hat folgendes geschrieben:
funktioniert doch noch normal...
alternativ:
ausblenden Quelltext
1:
2:
3:
4:
procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
key:=#0;
end;


Er biebt aber immer so. Besser gesagt "BING"!
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mo 10.03.03 22:36 
was biept??
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mo 10.03.03 22:37 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm6.Edit2KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  Mgs: TMsg;
begin
  if Key = VK_RETURN then
    begin
    PeekMessage(Mgs, 0, WM_CHAR, WM_CHAR, PM_REMOVE);
    //code
    end;
end;
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mo 10.03.03 22:37 
na wenn er in nem edit enter drückt
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Di 11.03.03 18:19 
schalte mal die eigenschaft ReadOnly(oder so änlich) im OE auf True ;)

_________________
MFG
Michael Springwald, "kann kein englisch...."
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 11.03.03 19:20 
dann kommt doch trotzdem der beep
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Di 11.03.03 19:50 
ausblenden Quelltext
1:
  if key = #13 then key:=0;					

ich glaube so schaltet man es ab;)

_________________
MFG
Michael Springwald, "kann kein englisch...."
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 11.03.03 20:23 
na ich habdoch auchgeschrieben, wie man es abschaltet :roll:


eben so:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm6.Edit2KeyDown(Sender: TObject; var Key: Word; 
  Shift: TShiftState); 
var 
  Mgs: TMsg; 
begin 
  if Key = VK_RETURN then 
    begin 
    PeekMessage(Mgs, 0, WM_CHAR, WM_CHAR, PM_REMOVE); 
    //code 
    end; 
end;
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Di 11.03.03 20:29 
oder halt auf meiner art und weise(ist viel kürtzer;))

_________________
MFG
Michael Springwald, "kann kein englisch...."
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 11.03.03 20:31 
hast ja recht
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 11.03.03 20:33 
ey,bei mir geht der coe net
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Di 11.03.03 20:34 
und wenn, dann müsste es
ausblenden Quelltext
1:
if key = (13) then key:=0;					

heißen, doch dasgeht net
denn dawerden einfach 2 tasten verarbeitet; eben:

13 und dann 0, damitwird aber 13 net verhindert oder umgeleitet
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Di 11.03.03 20:37 
ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if Key=#13 then
    Key:=#0;
end;

aus den EDH ;)

_________________
MFG
Michael Springwald, "kann kein englisch...."