AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi 'Enter' simulieren ;)
Thema durchsuchen
Ansicht
Themen-Optionen

'Enter' simulieren ;)

Ein Thema von KyroxX · begonnen am 12. Okt 2003 · letzter Beitrag vom 12. Okt 2003
 
ATwardz

Registriert seit: 12. Mai 2003
205 Beiträge
 
Delphi 7 Professional
 
#3

Re: 'Enter' simulieren ;)

  Alt 12. Okt 2003, 11:31
Hi, weiss nicht ob dir das was hilft bei deinem Vorhanben!

Das habe ich in der Delphi 6 Hilfe gefunden,

A KeyDown method is a protected method for a control’s OnKeyDown event. The control itself calls KeyDown in response to a Windows key-down message. When overriding the inherited KeyDown method, you can include code that provides other responses in addition to calling the OnKeyDown event.
To override KeyDown, follow these steps:

1 Add a KeyDown method to the TDBCalendar class:
[/delphi]
type

TDBCalendar = class(TSampleCalendar);
...
protected
procedure KeyDown(var Key: Word; Shift: TShiftState; X: Integer; Y: Integer);
override;
...
end;
[/delphi]
2 Implement the KeyDown method:
Delphi-Quellcode:
procedure KeyDown(var Key: Word; Shift: TShiftState);

var
  MyKeyDown: TKeyEvent;
begin
  if not ReadOnly and (Key in [VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT, VK_END,
    VK_HOME, VK_PRIOR, VK_NEXT]) and FDataLink.Edit then
    inherited KeyDown(Key, Shift)
  else
  begin
    MyKeyDown := OnKeyDown;
    if Assigned(MyKeyDown) then MyKeyDown(Self, Key, Shift);
  end;
end;
When KeyDown responds to a mouse-down message, the inherited KeyDown method is called only if the control’s ReadOnly property is False, the key pressed is one of the cursor control keys, and the datalink object is in edit mode, which means the field can be edited. If the field cannot be edited or some other key is pressed, the code the programmer put in the OnKeyDown event handler, if one exists, is executed.

Damit kann man den die keydown methode verallgemeinert!

@wardz
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz