关于DHtmledit 的简单问题(200分)

  • 主题发起人 vividwang
  • 开始时间
V

vividwang

Unregistered / Unconfirmed
GUEST, unregistred user!
哪为大虾知道如何用DHtmledit设置字体,如浏览器中的字体较大,中,较小等....
不胜感谢.
 
if DHTMLEdit.QueryStatus(DECMD_FONT) >= DECMDF_ENABLED then
DHTMLEdit.ExecCommand(DECMD_FONT, OLECMDEXECOPT_DODEFAULT);
 
我想做的不是输入字体,显示页面时候设置的,类似webbrowser
 
那为什么不Webbrowser控件?
DHtmlEdit设置了大小后可以在进行浏览亚!!
 
see
SAMPLE: IEZoom.exe Changes the Font Size of the WebBrowser Control

http://support.microsoft.com/default.aspx?scid=KB;EN-US;q156693
 
我之所以不用Webbrowser,是因为我已经用了DHtmlEdit,因为我需要编辑.但我又不想再
捆绑Webbrowser,主要考虑软件大小,所以.....总之多谢上边的兄弟的提示.
 
webbroswer 是ActiveX 控件,一般的机器都装 IE ,大小应该不成问题.
 
DHtmlEdit没有这样的接口么?
 
好久没理这个帖子了,再提一下,看看有没有知道的。
 
老兄,我也在用DHtmledit做个类似的东东。嘿,不过我是个初学者,不好意思,能指点指点偶吗?
 
procedure TForm1.Button1Click(Sender: TObject);
var
Range : OleVariant;
FontSize : OleVariant;
begin
Range := DHTMLEdit1.DOM.selection.createRange
FontSize := Edit1.Text;
Range.execCommand('FontSize',False,FontSize);
end;
 
realLearning兄,要如何控制在DHTMLEdit中的光标所在位置插入html代码?我的意思是要如何判断光标?
 
多人接受答案了。
 
请试一下下面的
Dim doc As Object
Dim sel As Object
Dim tr As Object

' get the DHTML Document object
Set doc = MainForm.DHTMLEdit1.DOM
' get the IE4 selection object
Set sel = doc.selection
' create a TextRange from the current selection
Set tr = sel.createrange

' paste our html into the range
tr.pasteHTML (HTMLText.Text)
Unload Me
 
顶部