![]() |
'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: |
Re: 'Enter' simulieren ;)
du hast aber schon das keypressevent belegt,oder?
|
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:
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.
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; Damit kann man den die keydown methode verallgemeinert! @wardz |
Re: 'Enter' simulieren ;)
sorry hatte etwas wenig schlaf. schau mal hier
![]() |
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:
Das sollte doch gehen?!
webbrowser1.OleObject.document.forms.item(0).elements.item('but').KeyPress(10);
Bekomme aber immer die Meldung: "Method "Keypress" not supported by automation object" Und ich habs auch schon mit:
Delphi-Quellcode:
und so auch:
webbrowser1.OleObject.document.forms.item(0).elements.item('but').Keybd_Event(VK_RETURN, 0, 0, 0);
Delphi-Quellcode:
Aber es will einfach nciht :/ :wall: *verzweifel*
webbrowser.OleObject.document.forms.item(0).elements.item('but').KeyDown(VK_RETURN);
|
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. |
Re: 'Enter' simulieren ;)
oki mal sehen ;)
|
Re: 'Enter' simulieren ;)
Zitat:
guckst Du ![]() [NACHTRAG] Das Zauberwort ist wohl WebForm.Submit |
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: |
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. |
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