在TWebBrowser.DesignMode='on'时,什么命令使所在行内容变成列表﹖

Frank6600 2009-11-30 01:36:28
在TWebBrowser.DesignMode='on'时,
如果用ExecCommand('Indent',...)可以使所在行内缩。

那么,用什么命令(或者任何可行方式)可以使所在行变成“列表”﹖

在TDHTMLEdit我是分别用ExecWB('OrderList')和ExecWB('BulletList')来使所在行变成列表的。
TWebBrowser下不知道最简单的做法是什么﹖
...全文
49 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Frank6600 2009-12-01
  • 打赏
  • 举报
回复
> (wb.Document as IHTMLDocument2).execCommand('InsertOrderedList',true,pInVar)
> (wb.Document as IHTMLDocument2).execCommand('InsertUnorderedList',true,pInVar);

嗯,验证结果是对的,iseekcode,谢谢你。
Frank6600 2009-11-30
  • 打赏
  • 举报
回复
> (wb.Document as IHTMLDocument2).execCommand('InsertOrderedList',true,pInVar)
> (wb.Document as IHTMLDocument2).execCommand('InsertUnorderedList',true,pInVar);

太谢谢了。
晚上回去试试。

不过,看到这些命令前面都有 Insert ,感觉怪怪的。

回去也试试

(wb.Document as IHTMLDocument2).execCommand('OrderedList',true,pInVar)
(wb.Document as IHTMLDocument2).execCommand('UnorderedList',true,pInVar);

看看这样子是不是对的。


iseekcode 2009-11-30
  • 打赏
  • 举报
回复
这是我写的自用切换orderlist的过程:
procedure SwitchList(wb:TWebBrowser;od:Boolean);
var pInVar: OleVariant;
begin
if od then
(wb.Document as IHTMLDocument2).execCommand('InsertOrderedList',true,pInVar) else
(wb.Document as IHTMLDocument2).execCommand('InsertUnorderedList',true,pInVar);
end;

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧