怎么将MSHtml里的一些元素和它的事件联系起来(100分)

  • 主题发起人 主题发起人 linuxping
  • 开始时间 开始时间
L

linuxping

Unregistered / Unconfirmed
GUEST, unregistred user!
MsHtml接口里定义了很多元素,比如:
IHTMLElementCollection = interface(IDispatch)
['{3050F21F-98B5-11CF-BB82-00AA00BDCE0B}']
function toString: WideString; safecall;
procedure Set_length(p: Integer); safecall;
function Get_length: Integer; safecall;
function Get__newEnum: IUnknown; safecall;
function item(name: OleVariant; index: OleVariant): IDispatch; safecall;
function tags(tagName: OleVariant): IDispatch; safecall;
property length: Integer read Get_length write Set_length;
property _newEnum: IUnknown read Get__newEnum;
end;
利用Item 和 tags可以得到各种元素。怎么把这些元素和它的事件联系起来呢?
比如文本框应该有change事件,提交按钮应该有click事件。。。。
另外,我看到SmHtml里还有:
HTMLElementEvents = dispinterface
['{3050F33C-98B5-11CF-BB82-00AA00BDCE0B}']
function onhelp: WordBool; dispid -2147418102;
function onclick: WordBool; dispid -600;
function ondblclick: WordBool; dispid -601;
function onkeypress: WordBool; dispid -603;
procedure onkeydown; dispid -602;
procedure onkeyup; dispid -604;
procedure onmouseout; dispid -2147418103;
procedure onmouseover; dispid -2147418104;
procedure onmousemove; dispid -606;
procedure onmousedown; dispid -605;
procedure onmouseup; dispid -607;
function onselectstart: WordBool; dispid -2147418100;
procedure onfilterchange; dispid -2147418095;
function ondragstart: WordBool; dispid -2147418101;
function onbeforeupdate: WordBool; dispid -2147418108;
procedure onafterupdate; dispid -2147418107;
function onerrorupdate: WordBool; dispid -2147418099;
function onrowexit: WordBool; dispid -2147418106;
procedure onrowenter; dispid -2147418105;
procedure ondatasetchanged; dispid -2147418098;
procedure ondataavailable; dispid -2147418097;
procedure ondatasetcomplete; dispid -2147418096;
procedure onlosecapture; dispid -2147418094;
。。。。
这些好象是事件的定义。。。
具体该怎么做?
 
up up up up up up up up up up up up up up
 
后退
顶部