zoukankan
html css js c++ java
控件设计时的属性页定位办法
控件设计时的属性页定位办法:
取得IHtmlDocument3 就随心所欲了。
public
LabelComponentEditorForm(ComponentEditorLabel designComponent)
{
this
.designComponent
=
designComponent;
int
innerLeft
=
Convert.ToInt32(designComponent.Style[
"
clientX
"
]);
int
innerTop
=
Convert.ToInt32(designComponent.Style[
"
clientY
"
]);
IDesignerHost host
=
(IDesignerHost) designComponent.Site.GetService(
typeof
(IDesignerHost));
ControlDesigner labelDesigner
=
(ControlDesigner) host.GetDesigner(designComponent);
object
parent
=
labelDesigner.Behavior.GetAttribute(
"
document
"
,
false
);
IHTMLDocument2 doc
=
(IHTMLDocument2) parent;
mshtml.IHTMLWindow3 window
=
(IHTMLWindow3) doc.parentWindow;
int
screenLeft
=
window.screenLeft;
int
screenTop
=
window.screenTop;
this
.Location
=
new
Point(screenLeft
+
innerLeft, screenTop
+
innerTop);
//
//
Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
//
TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
效果如下:
查看全文
相关阅读:
我的图片爬虫demo
修改django后台用户名和密码
mybatis知识点(已掌握)
python3与python2的区别(目前遇到的)
Linux 日常命令
手机号码归属地查询api接口
Install-Package EntityFramework -version 5.0.0.0
【迁移】—Entity Framework实例详解
Android Http请求方法汇总
Android数据存储的5种方法
原文地址:https://www.cnblogs.com/xiaotaoliang/p/385951.html
最新文章
select * from a, b的意思
Jquery+ashx实现Ajax
jquery获得下拉框的值
eval()将json 字符串转换为数组
SQL中的循环、for循环、游标
sql游标的使用
SQL Server2008函数大全(完整版)
Sqlserver中存储过程,触发器,自定义函数(二)
Sqlserver中存储过程,触发器,自定义函数(一)
Sqlserver中存储过程,触发器,自定义函数
热门文章
SQL 语句转换格式函数Cast、Convert 区别
【Oracle经典】132个oracle热门精品资料——下载目录
SQL SERVER 中的 object_id()函数
触发器
AVL树
自顶向下的红黑树
java深拷贝与浅拷贝
java序列化的认识(从多本书和多个博客中的总结)
最近读jdk源码一些基础的总结(有待后续深入)
pep8 && pep20
Copyright © 2011-2022 走看看