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

推荐订阅源

TaoSecurity Blog
TaoSecurity Blog
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Security Archives - TechRepublic
Security Archives - TechRepublic
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
The Hacker News
The Hacker News
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
F
Full Disclosure
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Security @ Cisco Blogs
H
Hacker News: Front Page
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
B
Blog RSS Feed
H
Heimdal Security Blog
Google Online Security Blog
Google Online Security Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 三生石上(FineUI控件)
V2EX - 技术
V2EX - 技术
V
Vulnerabilities – Threatpost
Help Net Security
Help Net Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
W
WeLiveSecurity
T
Tenable Blog
D
DataBreaches.Net
Martin Fowler
Martin Fowler
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
S
Secure Thoughts
O
OpenAI News
L
LINUX DO - 热门话题
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Jina AI
Jina AI
J
Java Code Geeks
Know Your Adversary
Know Your Adversary
IT之家
IT之家
Latest news
Latest news
Cloudbric
Cloudbric

博客园 - 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