Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Netzwerke (https://www.delphipraxis.net/14-netzwerke/)
-   -   Delphi 'Enter' simulieren ;) (https://www.delphipraxis.net/10133-enter-simulieren-%3B.html)

KyroxX 12. Okt 2003 11:24


'Enter' simulieren ;)
 
Moin mal wieder ;)

Ich möchte mein Forumlar automatisch absenden und denke mal das das am einfachsten geht, indem ich ein 'Enter' simuliere :D

Ich habs schon mit 'chr(10)' und 'Key=#13' usw probiert aber irgendiwe hautz nicht hin ^^

Gibts noch ne andre Möglichkeit ein Formular zu 'Submitten' ? ;)

:cyclops:

kiar 12. Okt 2003 11:29

Re: 'Enter' simulieren ;)
 
du hast aber schon das keypressevent belegt,oder?

ATwardz 12. Okt 2003 11:31

Re: 'Enter' simulieren ;)
 
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

kiar 12. Okt 2003 11:38

Re: 'Enter' simulieren ;)
 
sorry hatte etwas wenig schlaf. schau mal hier
http://www.delphipraxis.net/internal...ht=sendmessage

KyroxX 12. Okt 2003 12:34

Re: 'Enter' simulieren ;)
 
Hmm ich habs mal so probiert:

'But' ist der Name für den Button.
Keypress 10 oder 13?! ist Enter...

Delphi-Quellcode:
webbrowser1.OleObject.document.forms.item(0).elements.item('but').KeyPress(10);
Das sollte doch gehen?!

Bekomme aber immer die Meldung:
"Method "Keypress" not supported by automation object"

Und ich habs auch schon mit:

Delphi-Quellcode:
webbrowser1.OleObject.document.forms.item(0).elements.item('but').Keybd_Event(VK_RETURN, 0, 0, 0);
und so auch:

Delphi-Quellcode:
webbrowser.OleObject.document.forms.item(0).elements.item('but').KeyDown(VK_RETURN);
Aber es will einfach nciht :/ :wall: *verzweifel*

Sharky 12. Okt 2003 12:37

Re: 'Enter' simulieren ;)
 
Hai KyroxX,

da Du deine Frage in "Internet/IP/LAN" gepostest hast denke ich Du möchtest das ENTER bei einer WEB-Seite simmulieren.
Ich glaube das hatten wir schon einmal im Forum. Suche mal nach Button und WEB-Seite.

KyroxX 12. Okt 2003 12:40

Re: 'Enter' simulieren ;)
 
oki mal sehen ;)

Sharky 12. Okt 2003 12:44

Re: 'Enter' simulieren ;)
 
Zitat:

Zitat von KyroxX
oki mal sehen ;)

Hai KyroxX,

guckst Du hier


[NACHTRAG]
Das Zauberwort ist wohl WebForm.Submit

KyroxX 12. Okt 2003 13:01

Re: 'Enter' simulieren ;)
 
Ja-NE das Zauberwort heisst bei mit eher
uses mshtml

guggst du in activX control und installierst HTML Objects Libary und trotzdem
holt debugga seine bruda ^^ :wall:

:roll:

Langsam nervt mich das :mrgreen:
Um die mshtml unit zu nutzen muss ich da noch mehr activx zeugs installen als
Internet Controls und HTML Objects?

Ich hab auch mal mit "Forms 2.0 Libary" liebgeäugelt aber der meckert wegen ner DB unit :wall:

KyroxX 12. Okt 2003 14:49

Re: 'Enter' simulieren ;)
 
ok, habs jetzt *lol* unit hieß MSHTML_TLB nicht mshtml :p

Hmm, aber ich bekomm immernoch den gleichen fehler ^^ :(

"Method "webform" not supported by automation object"

Delphi-Quellcode:
chaosbrowser.OleObject.document.forms.item('f').elements.item('but').WebForm.submit;

p.s.: Wenn ich des Webform.submit; so reinbaue hagelt es auch fehler ...


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:34 Uhr.
Seite 1 von 2  1 2      

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