//handle select element.
<SELECT NAME="Cats" SIZE="1">
<OPTION VALUE="1">Calico
<OPTION VALUE="2">Tortie
<OPTION VALUE="3" SELECTED>Siamese
</SELECT>
HRESULT IHTMLSelectElement::get_selectedIndex(long *p);HRESULT IHTMLSelectElement::put_selectedIndex(long v);
<SELECT NAME="Cats" SIZE="1">
<OPTION VALUE="1">Calico
<OPTION VALUE="2">Tortie
<OPTION VALUE="3" SELECTED>Siamese
</SELECT>
HRESULT IHTMLSelectElement::get_selectedIndex(long *p);HRESULT IHTMLSelectElement::put_selectedIndex(long v);
解决方案 »
- 有无办法得到鼠标移动到的位置是不是菜单项。
- cxlookupcombobox控件源码修改后出错?
- 用delphi 如何把自己的程序附加在别的执行文件上。就像病毒一样的。
- 数据库平均分的统计
- 关于一些控件的问题!
- dll读写注册表问题。
- (紧急求救)DBLookupComboBox就不能象TComboBox那样自己定义ItemIndex吗?
- 谁有GIF控件,发给我一个,谢谢!
- Delphi6+SqlServer退出时报"Connection Timed Out!"错误!
- sequoia速来拿分
- 悲愤,离别CSDN,散分:欢迎以下给予我帮助的人士进来拿分:firstshine , zx_wang(wzx), larky(睡仙) , CoolSlob()
- 如何保存Delphi里页面设置?
请再次解答我的问题,谢谢!
//表单上 WebBrowser:TWebBrowsers;Edit1:Tedit
procedure TWebForm.Button1Click(Sender: TObject); //write
var iDoc:IHTMLDocument2;
iELC:IHTMLElementCollection;
HtmlInputEle : IHTMLInputElement; //输入文件类型,这里是edit
// HTMLSelectEle: IHTMLSelectElement; //输入文件类型,这里是ComboBox
Disp:IDispatch;
i:integer;
begin
iDoc:=WebBrowser.Document as IHTMLDocument2;
if iDoc<>nil then
begin
iELC:=iDoc.Get_all;
for i:=0 to iELC.length-1 do
begin
Application.ProcessMessages;
Disp:=iELC.item(i,0);
if SUCCEEDED(Disp.QueryInterface(IHTMLInputElement ,HtmlInputEle))then
begin
if (CompareText(trim(HtmlInputEle.name),'T0')=0) then
HtmlInputEle.value:=edit1.Text;
end;
end;
end;
end;