下面是DHTML EDIT的一个简单的例子。在这个例子中,窗体上有一个DHTML EDIT的控件以及三个按钮:Open,Save以及Insert Image。点击Insert Image按钮以后会在已经打开的HTML文档中鼠标所在的地方插入一幅图片:object path="c:\\test.html";
object nothing=System.Reflection.Missing.Value;private void buttonInsertImage_Click(object sender, System.EventArgs e){
this.axDHTMLEdit1.DOM.execCommand("InsertImage",false,@"http://www.google.com/images/hp0.gif");
}private void buttonOpen_Click(object sender, System.EventArgs e){
this.axDHTMLEdit1.LoadDocument(ref path,ref nothing);
this.axDHTMLEdit1.BrowseMode=false;
}private void buttonSave_Click(object sender, System.EventArgs e){
this.axDHTMLEdit1.SaveDocument(ref path,ref nothing);
}希望以上例子对你能有所帮助。更具体的使用方法请参考http://msdn.microsoft.com/workshop/browser/mshtml/mshtml_editing_node_entry.asp
Hogwarts - S(u)ddenly dis@ppeared...

本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。  

解决方案 »

  1.   

    The DHTML Editing Component
    The DHTML Editing Component and ActiveX control are still available. They provide similar features to the MSHTML Editor, though they are not customizable. The DHTML Editing Component includes the following features:Table operations (insert row, insert column, merge cells, and so on).
    Absolute drop mode.
    Source code white space and formatting preservation.
    Active Server Page script preservation.
    The DHTML Editing Component ActiveX control provides the functionality of the DHTML Editing Component implemented in an easy-to-use control. The control also adds:Loading and saving files.
    Context menu support.
    Keyboard accelerators.
    Properties, methods, and events that expose editing functionality.