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

推荐订阅源

大猫的无限游戏
大猫的无限游戏
H
Help Net Security
The Cloudflare Blog
Y
Y Combinator Blog
A
Arctic Wolf
Cyberwarzone
Cyberwarzone
G
Google Developers Blog
Recent Announcements
Recent Announcements
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
WordPress大学
WordPress大学
博客园 - Franky
罗磊的独立博客
Martin Fowler
Martin Fowler
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 三生石上(FineUI控件)
N
News and Events Feed by Topic
F
Fortinet All Blogs
N
News | PayPal Newsroom
J
Java Code Geeks
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 【当耐特】
M
MIT News - Artificial intelligence
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
博客园 - 聂微东
S
Securelist
C
CERT Recently Published Vulnerability Notes
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
S
Security Affairs
NISL@THU
NISL@THU
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
AWS News Blog
AWS News Blog
GbyAI
GbyAI
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Vulnerabilities – Threatpost
D
Docker
P
Proofpoint News Feed
W
WeLiveSecurity
Help Net Security
Help Net Security
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
The Hacker News
The Hacker News
博客园 - 叶小钗

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

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