Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
Delphi 5 Professional
|
Re: Mehrere Einträge einer Selectbox(Html) mit Delphi anspre
6. Jan 2005, 14:21
2. und 3. Eintrag markieren:
Delphi-Quellcode:
WebBrowser1.OleObject.document.forms.item('form1').item('select').item(1).selected := True;
WebBrowser1.OleObject.document.forms.item('form1').item('select').item(2).selected := True;
oder halt so:
Delphi-Quellcode:
var
WebDoc: HTMLDocument;
WebForm: HTMLFormElement;
WebElement: HTMLSelectElement;
WebOption: HTMLOptionElement;
begin
WebDoc := WebBrowser1.Document as HTMLDocument;
WebForm := WebDoc.forms.item('form1', 0) as HTMLFormElement;
WebElement := WebForm.item('select', 0) as HTMLSelectElement;
WebOption := WebElement.item(1, 0) as HTMLOptionElement;
WebOption.selected := True;
WebOption := WebElement.item(2, 0) as HTMLOptionElement;
WebOption.selected := True;
end;
Ciao, Sprint.
"I don't know what I am doing, but I am sure I am having fun!"
|