Autor Beitrag
Prinz_Inside
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 29



BeitragVerfasst: So 07.08.05 21:16 
Hallo!

Möchte dass sobald eine bestimmte seite geladen wird, automatisch ein klick auf einen buttonm auf der seite gemacht wird.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm2.BrowserDocumentComplete(ASender: TObject;
  const pDisp: IDispatch; var URL: OleVariant);
begin
if (Pos('testfile', Browser.LocationUrl) > 0) then
  Browser.OleObject.Document.Forms.Item(0).Elements.Item(2).Click;
end;


Die if-Zeile gibt aber true zurück!

Wenn ich aber die Zeile für den Kick auf nen Button auf meiner Form lege und dann draufdrücke, funktionierts...

Warum gehts das net?!

Danke!
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: So 07.08.05 21:28 
wird wohl so sein das bei DocumentComplete die if abfrage noch nicht wahr zurückliefert
d.h.
'testfile' nicht in Browser.LocationUrl vorhanden ist

am besten setzt du mal einen breakpoint bei DocumentComplete und schasut mal ob der im singlestep den Click ausführt

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Prinz_Inside Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 29



BeitragVerfasst: So 07.08.05 21:54 
wenn ich das "if" rausnehm, bekomm ich ein paar AVs aber der button wird gedrückt :?