惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
T
Troy Hunt's Blog
GbyAI
GbyAI
H
Hacker News: Front Page
SecWiki News
SecWiki News
V2EX - 技术
V2EX - 技术
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
Hacker News: Ask HN
Hacker News: Ask HN
S
Secure Thoughts
Last Week in AI
Last Week in AI
MyScale Blog
MyScale Blog
L
LINUX DO - 最新话题
C
CERT Recently Published Vulnerability Notes
C
Cyber Attacks, Cyber Crime and Cyber Security
O
OpenAI News
S
SegmentFault 最新的问题
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Cloudflare Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
Google DeepMind News
Google DeepMind News
Simon Willison's Weblog
Simon Willison's Weblog
Know Your Adversary
Know Your Adversary
K
Kaspersky official blog
T
The Exploit Database - CXSecurity.com
S
Securelist
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog RSS Feed
L
Lohrmann on Cybersecurity
Spread Privacy
Spread Privacy
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
The GitHub Blog
The GitHub Blog
B
Blog
F
Fortinet All Blogs
I
InfoQ
C
Check Point Blog
Webroot Blog
Webroot Blog
博客园 - 叶小钗
P
Privacy International News Feed
Latest news
Latest news
Forbes - Security
Forbes - Security
博客园 - 三生石上(FineUI控件)
N
News | PayPal Newsroom

博客园 - bobbychen

C++之不带指针类的设计——Boolean .ctor,.cctor 以及 对象的构造过程 C#中virtual 方法和abstract方法的区别 SQL循环插入批量数据 【VS.NET 调试异常】 CLR 无法从 COM 上下文 XXX 转换为 COM 上下文 XXX SQL重复记录查询 String.Format格式说明 C#数字格式化方法全面解析 HTML特殊字符 - 补遗 【Access】 LEFT OUTER JOIN 关联多表的查询语句 【转帖】C#与C Windows API数据类型对应关系 Visual Studio 进行单元测试时如何附加被测试文件的方法总结 【转帖】C# 与 C++ 数据类型对照 【.Net Compact Framework开发】 使用 Visual Studio 对移动项目进行Unit Testing的方法总结 【转帖】const 与 readonly 的区别 PowerDesigner实体模型CDM中关于建立Entity之间关系的备忘 【部署】Visual Studio 2008 打包部署.Net Framework 2.0 应用程序提示需要安装.Net Framework 3.5的解决方法 SQL 使用CONVERT函数 格式化日期 【Winform窗体控件开发】之五 实现类型转换器TypeConverterAttribute
【转帖】解决继承窗体或用户控件时“visual继承当前被禁用,因为基类引用设备特定的组件或包含 p/invoke”问题
bobbychen · 2011-08-08 · via 博客园 - bobbychen

当自定义控件所在的dll中出现了DllImport 属性时候,自定义类型的控件属性就不能正常显示在属性窗口了

通过将 DesktopCompatible(true) 属性放置在父窗体或父用户控件中,可以安全地启用可视继承

先在项目中添加一个“设计时属性文件”默认名为DesignTimeAttributes1.xmta

然后在其中添加如下节点

<Class Name="SmartDeviceProject1.Form1">  
<DesktopCompatible>true</DesktopCompatible>
</Class>

SmartDeviceProject1.Form1为被继承的类名,

ok,这样应该就能解决问题了

如果自己写的控件类,需要在设计视图中显示内容也可以通过在此文件中添加如下节点:

<Class Name="ImageButton">  
<DesktopCompatible>true</DesktopCompatible>
<Property Name="Size">
<DefaultValue>
<Type>System.Drawing.Size, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Type>
<Value>16, 16</Value>
</DefaultValue>
</Property>
</Class>

这里ImageButton为控件的类名。

文章出处:http://blog.csdn.net/sohighthesky/article/details/4249129