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

推荐订阅源

云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
Vercel News
Vercel News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 叶小钗
F
Fortinet All Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 最新话题
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
Recent Announcements
Recent Announcements
Recent Commits to openclaw:main
Recent Commits to openclaw:main
PCI Perspectives
PCI Perspectives
Cloudbric
Cloudbric
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
IT之家
IT之家
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
J
Java Code Geeks
M
MIT News - Artificial intelligence
Cisco Talos Blog
Cisco Talos Blog
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Microsoft Security Blog
Microsoft Security Blog
Cyberwarzone
Cyberwarzone
博客园 - 聂微东
G
Google Developers Blog
W
WeLiveSecurity
罗磊的独立博客
P
Privacy & Cybersecurity Law Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
T
Tailwind CSS Blog
V
Visual Studio Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Secure Thoughts
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
Google DeepMind News
Google DeepMind News
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Full Disclosure
Blog — PlanetScale
Blog — PlanetScale
The Last Watchdog
The Last Watchdog
P
Proofpoint News Feed

博客园 - 天马行空(笨笨)

libcurl的使用(转) 使用Visual Studio 2010 Team System中的架构师工具(设计与建模) Silverlight 框架介绍 Silverlight 介绍(转) 使用MAP文件快速定位程序崩溃代码行(转) Pocket PC 模拟器上网设置 操作MSN(IM)相关的资源 用户中心 - 博客园 压缩SQLServer数据库日志的一个存储过程 .net的辅助工具列表 Eclipse+JDK+API中文帮助文档的java开发环境搭建 淺談如何使用Delphi 2009的泛型容器類別 Delphi2009带来了什么 NET开源项目链接(转载) Google Chrome 源码下载 版本控制工具SVN和CVS 用DOS命令安装删除服务 我要向党和人民道歉:我错了(韩国行有感)--转贴 论韩寒"大师"与鲁迅先生
解决继承窗体或用户控件时“visual继承当前被禁用,因为基类引用设备特定的组件或包含 p/invoke”问题(转)
天马行空(笨笨) · 2009-07-09 · via 博客园 - 天马行空(笨笨)

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

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

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

然后在其中添加如下节点view plaincopy to clipboardprint?
<Class Name="SmartDeviceProject1.Form1"> 
  <DesktopCompatible>true</DesktopCompatible> 
</Class> 
  <Class Name="SmartDeviceProject1.Form1">
    <DesktopCompatible>true</DesktopCompatible>
  </Class>

SmartDeviceProject1.Form1为被继承的类名,

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

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

view plaincopy to clipboardprint?
<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> 
  <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为控件的类名


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/sohighthesky/archive/2009/06/07/4249129.aspx