Autor Beitrag
DeltaEx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110



BeitragVerfasst: Do 20.10.05 15:15 
Hallo Leute,

Ich habe ein TrayIcon wenn ich drauf einmal klicke, erscheint eine Form mit einem Edit1.
Ich setze auf das Edit1 den Focus ... so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm3.FormPaint(Sender: TObject);
begin
  Edit1.Focused;
end;


Das Edit1 bekommt den Focus auch und der Cursor blinkt im Edit1.
Das Problem ist, ich kann nix reinschreiben ... erst wenn ich mit der Maus auf das Edit1 Feld
klicke dann ich da reinschreiben. Wieso ist das so?

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.

_________________
Delphi forever
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 20.10.05 15:47 
Moin!

Probier mal Edit1.SetFocus;

cu
Narses
DeltaEx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110



BeitragVerfasst: Do 20.10.05 15:51 
Sorry Tippfehler ich habe das SetFocus stehen. Und damit geht es nicht.

Hier mal der Ganze Source:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm3 = class(TForm)
    Edit1: TEdit;
    procedure Edit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure FormPaint(Sender: TObject);
    procedure Edit1Enter(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

uses Unit1;
{$R *.dfm}

procedure TForm3.Edit1Enter(Sender: TObject);
begin
   //Form3.Hide;
end;

procedure TForm3.FormPaint(Sender: TObject);
begin
  Edit1.SetFocus;
end;

procedure TForm3.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   if Key = 13 then
    begin
      Form1.quick := True;
      Form1.quickquery := 'SELECT ID,name,vorname,teld,handyd,handy,telprivat FROM kontakte WHERE name LIKE ''' + Edit1.Text + '%'' OR vorname LIKE ''' + Edit1.Text + '%'' ORDER BY name, vorname';
      Form1.EditFilter.Text := Form3.Edit1.Text;
      Form1.JvTrayIcon.ShowApplication;
      Form3.Hide;
    end
end;


end.


Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt

_________________
Delphi forever