Autor Beitrag
Horschdware
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Sa 22.04.06 23:09 
Hallo,
wie kann ich verhindern, dass ein TMemo einen Focus erhält, ohne das Memo auf Enabled:=false zu setzen? Ich will komplett verhindern dass der Focus gesetzt wird und nicht erst einen bereits gesetzten Focus wieder entfernen.

MfG
Stefan

_________________
Delphi: XE - OS: Windows 7 Professional x64
DelphiAnfänger
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 112

Win XP, Firefox 2.0, IE6
Delphi 5 Prof., Delphi 2005 PE
BeitragVerfasst: Sa 22.04.06 23:19 
ich weiss nich genau was du meinst :gruebel:
falls du verhindern willst, dass der user eingaben macht dann setz readonly auf true
Horschdware Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Sa 22.04.06 23:20 
Ja, aber dann kann immer noch ein Focus auf das Memo gesetzt werden. Und das soll verhindert werden. Readonly ist es sowieso schon.

_________________
Delphi: XE - OS: Windows 7 Professional x64
DelphiAnfänger
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 112

Win XP, Firefox 2.0, IE6
Delphi 5 Prof., Delphi 2005 PE
BeitragVerfasst: Sa 22.04.06 23:23 
probier mal wenn du im memo bei onenter irgeneineinem andren element (z.B. einem button) den focus gibst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Memo1Enter(Sender: TObject);
begin
Button1.Setfocus;
end;
Horschdware Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Sa 22.04.06 23:26 
user profile iconHorschdware hat folgendes geschrieben:
Hallo,
wie kann ich verhindern, dass ein TMemo einen Focus erhält, ohne das Memo auf Enabled:=false zu setzen? Ich will komplett verhindern dass der Focus gesetzt wird und nicht erst einen bereits gesetzten Focus wieder entfernen.

MfG
Stefan


^^

_________________
Delphi: XE - OS: Windows 7 Professional x64
Born-to-Frag
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1094

Win XP SP2, Win 2000 SP4
Delphi 7, 2k5
BeitragVerfasst: Sa 22.04.06 23:34 
Ich bin mir jetzt nicht ganz sicher, aber warum machst du nicht einfach MemoX.CanFocus := False; ?

greetz

EDIT: Mein Fehler, geht garnich :oops:

_________________
Theorie ist wenn man alles weiß, aber nichts funktioniert. Praxis ist wenn alles funktioniert, aber niemand weiß warum.
Microsoft vereint Theorie und Praxis: Nichts funktioniert und niemand weiß warum.
Horschdware Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: Sa 22.04.06 23:50 
CanFocus ist keine Property von TMemo sondern nur eine function...
Zum Mäusemelken das ganze...

_________________
Delphi: XE - OS: Windows 7 Professional x64
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Sa 22.04.06 23:57 
Was ist daran so schlimm, wenn das Memo mal ganz kurz den Fokus erhält?

_________________
Programmers never die, they just GOSUB without RETURN
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: So 23.04.06 08:25 
Ich weiß jetzt nicht, wie oft ich dieses Verfahren schon beschrieben habe. Aber gut. ein weiteres Mal :angel:
Nimm ein Panel, Borderstyle auf bsNone etc, sodass es man keine Ränder sieht. Pack das Memo auf das Panel, Align auf alClient. Setze Panel1.enabled := False. Dann hast du ein Memo, was nicht anklickbar ist, aber so aussieht wie ein ganz normales.

_________________
We are, we were and will not be.
dh
Hält's aus hier
Beiträge: 11


Delphi 6 PE, Delphi 7 Prof., Delphi 8 Prof., C++, Java, PHP
BeitragVerfasst: So 23.04.06 14:31 
Ich hatte mal ein ähndliches Problem.
Wenn du den Focus einfach "weggnehmen" willst, gib folgendes ein:
[highlight]
Form1.FocusControl(nil);
[/highlight]

Nach der Ausführung besitzt nichts mehr den Focus.

Mfg @DH
wp_xxyyzz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40



BeitragVerfasst: So 23.04.06 17:07 
Memo1.TabStop := false;
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 23.04.06 17:13 
Gausis Lösung tut doch genau das, was gefragt war... :roll:

_________________
Programmers never die, they just GOSUB without RETURN
Horschdware Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 744
Erhaltene Danke: 54

Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
BeitragVerfasst: So 23.04.06 19:24 
Danke Gausi!
Auf die Idee bin ich noch gar nicht gekommen.
Einfach und funtkioniert.

-> Problem gelöst

_________________
Delphi: XE - OS: Windows 7 Professional x64