<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>bb|!bb ... WHO CARES? JUST GO ON. - faq</title>
    <link>http://oldblog.holgerferstl.de/</link>
    <description>Holgers Blog</description>
    <language>en-us</language>
    <copyright>Your Name Here</copyright>
    <lastBuildDate>Mon, 28 Feb 2005 23:27:58 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>sephi@gmx.net</managingEditor>
    <webMaster>sephi@gmx.net</webMaster>
    <item>
      <trackback:ping>http://oldblog.holgerferstl.de/Trackback.aspx?guid=6b49ae7e-afcc-46e9-ba28-b29cf95183de</trackback:ping>
      <pingback:server>http://oldblog.holgerferstl.de/pingback.aspx</pingback:server>
      <pingback:target>http://oldblog.holgerferstl.de/PermaLink,guid,6b49ae7e-afcc-46e9-ba28-b29cf95183de.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://oldblog.holgerferstl.de/CommentView,guid,6b49ae7e-afcc-46e9-ba28-b29cf95183de.aspx</wfw:comment>
      <wfw:commentRss>http://oldblog.holgerferstl.de/SyndicationService.asmx/GetEntryCommentsRss?guid=6b49ae7e-afcc-46e9-ba28-b29cf95183de</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
After many hours of search for a possibility to change the name and bitmap of my custom
user controls in the Visual Studio Toolbox, here is the solution.
</p>
        <p>
          <strong>1)</strong> Set the ToolboxItem Attribute to the UserControl<br /><br /><font size="1">[ToolboxItem(<font color="#0000ff">typeof</font>(MyToolboxItem))]<br /><font color="#0000ff">public</font><font color="#0000ff">class</font> MyUserControl
: System.Windows.Forms.UserControl {...}</font></p>
        <p>
          <strong>2)</strong> create a class, derived from ToolboxItem class<br /><br /><font color="#0000ff" size="1">using</font><font size="1"><font color="#000000"> System.Runtime.Serialization;<br /></font><font color="#0000ff">using</font></font><font color="#000000" size="1"> System.Drawing.Design;<br /></font><br /><font size="1">[Serializable]<br /><font color="#0000ff">public</font><font color="#0000ff">class</font> MyToolboxItem
: ToolboxItem{<br /><font color="#0000ff">   public</font> MyToolboxItem() : <font color="#0000ff">base</font>(){<br /><font size="2"><font size="1">       DoMagic();<br /></font></font></font><font size="1">   }<br /></font><font size="1"><font color="#0000ff"><br />
   public</font> MyToolboxItem (Type type) : <font color="#0000ff">base</font>(type){<br />
       DoMagic();<br /></font><font size="1">   }<br /></font><font size="1"><font color="#0000ff" size="2"><font size="1"><br />
   void</font></font><font color="#000000"> DoMagic(){<br />
       <font color="#008000">//set the desired
text</font><br /></font><font color="#0000ff">       base</font>.DisplayName
= "MyText";<br /><font color="#008000">       //load the embedded resource
bitmap</font><br /><font color="#0000ff">       base</font>.Bitmap = <font color="#0000ff">new </font><font size="2"><font size="1">System.Drawing.Bitmap(GetType().Module.Assembly.GetManifestResourceStream("MyBitmap.bmp"));<br />
    }</font></font></font></p>
        <p>
          <font size="1">
            <font color="#0000ff">
              <font color="#008000">   //a very special
constructor<br /></font>   private</font> MyToolboxItem (SerializationInfo info, StreamingContext
context) {<br /></font>
          <font size="1">
            <font color="#0000ff">       base</font>.Deserialize(info,
context);<br /></font>
          <font size="1">   }<br /></font>
          <font size="1">}</font>
        </p>
        <p>
          <font size="1">
            <font size="2">some notes:<br />
At First, if you try to "override" the <em>DisplayName</em> and <em>Bitmap</em> properties,
it won't work. It will only work, if these base properties are set in the constructor
... very strange.<br /><br />
Second, the private deserialize constructor must be set, else the ToolboxItem will
throw an exception if you try to insert it in the form  ...  many thanks
to reflector for solving this problem *g*</font>
          </font>
        </p>
        <img width="0" height="0" src="http://oldblog.holgerferstl.de/aggbug.ashx?id=6b49ae7e-afcc-46e9-ba28-b29cf95183de" />
      </body>
      <title>visual studio customization, 2nd</title>
      <guid isPermaLink="false">http://oldblog.holgerferstl.de/PermaLink,guid,6b49ae7e-afcc-46e9-ba28-b29cf95183de.aspx</guid>
      <link>http://oldblog.holgerferstl.de/2005/02/28/visualStudioCustomization2nd.aspx</link>
      <pubDate>Mon, 28 Feb 2005 23:27:58 GMT</pubDate>
      <description>&lt;p&gt;
After many hours of search for a possibility to change the name and bitmap of my custom
user controls in the Visual Studio Toolbox, here is the solution.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;1)&lt;/strong&gt; Set the ToolboxItem Attribute to the UserControl&lt;br&gt;
&lt;br&gt;
&lt;font size=1&gt;[ToolboxItem(&lt;font color=#0000ff&gt;typeof&lt;/font&gt;(MyToolboxItem))]&lt;br&gt;
&lt;font color=#0000ff&gt;public&lt;/font&gt; &lt;font color=#0000ff&gt;class&lt;/font&gt; MyUserControl :
System.Windows.Forms.UserControl {...}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;2)&lt;/strong&gt; create a class, derived from ToolboxItem class&lt;br&gt;
&lt;br&gt;
&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Runtime.Serialization;&lt;br&gt;
&lt;/font&gt;&lt;font color=#0000ff&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font color=#000000 size=1&gt; System.Drawing.Design;&lt;br&gt;
&lt;/font&gt;
&lt;br&gt;
&lt;font size=1&gt;[Serializable]&lt;br&gt;
&lt;font color=#0000ff&gt;public&lt;/font&gt; &lt;font color=#0000ff&gt;class&lt;/font&gt; MyToolboxItem :
ToolboxItem{&lt;br&gt;
&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp; public&lt;/font&gt; MyToolboxItem() : &lt;font color=#0000ff&gt;base&lt;/font&gt;(){&lt;br&gt;
&lt;font size=2&gt;&lt;font size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoMagic();&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=1&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#0000ff&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; public&lt;/font&gt; MyToolboxItem (Type type) : &lt;font color=#0000ff&gt;base&lt;/font&gt;(type){&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoMagic();&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#0000ff size=2&gt;&lt;font size=1&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;void&lt;/font&gt;&lt;/font&gt;&lt;font color=#000000&gt; DoMagic(){&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=#008000&gt;//set the&amp;nbsp;desired text&lt;/font&gt;
&lt;br&gt;
&lt;/font&gt;&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base&lt;/font&gt;.DisplayName
= "MyText";&lt;br&gt;
&lt;font color=#008000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //load the embedded resource
bitmap&lt;/font&gt;
&lt;br&gt;
&lt;font color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base&lt;/font&gt;.Bitmap = &lt;font color=#0000ff&gt;new &lt;/font&gt;&lt;font size=2&gt;&lt;font size=1&gt;System.Drawing.Bitmap(GetType().Module.Assembly.GetManifestResourceStream("MyBitmap.bmp"));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&gt;&gt;&lt;font size=1&gt;&lt;font color=#0000ff&gt;&lt;font color=#008000&gt;&amp;nbsp;&amp;nbsp; //a very special
constructor&lt;br&gt;
&lt;/font&gt;&amp;nbsp;&amp;nbsp; private&lt;/font&gt; MyToolboxItem (SerializationInfo info, StreamingContext
context) {&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#0000ff&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;base&lt;/font&gt;.Deserialize(info,
context);&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;}&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font size=1&gt;&lt;font size=2&gt;some notes:&lt;br&gt;
At First, if you try to "override" the &lt;em&gt;DisplayName&lt;/em&gt; and &lt;em&gt;Bitmap&lt;/em&gt; properties,
it won't work. It will only work, if these base properties are set in the constructor
... very strange.&lt;br&gt;
&lt;br&gt;
Second, the private deserialize constructor must be set, else the ToolboxItem will
throw an exception if you try to insert it in the form&amp;nbsp; ...&amp;nbsp; many thanks
to reflector for solving this problem *g*&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://oldblog.holgerferstl.de/aggbug.ashx?id=6b49ae7e-afcc-46e9-ba28-b29cf95183de" /&gt;</description>
      <comments>http://oldblog.holgerferstl.de/CommentView,guid,6b49ae7e-afcc-46e9-ba28-b29cf95183de.aspx</comments>
      <category>coden</category>
      <category>dddwik</category>
      <category>faq</category>
    </item>
    <item>
      <trackback:ping>http://oldblog.holgerferstl.de/Trackback.aspx?guid=5ae50eb8-0e0d-4d6d-acd8-e382743fca7a</trackback:ping>
      <pingback:server>http://oldblog.holgerferstl.de/pingback.aspx</pingback:server>
      <pingback:target>http://oldblog.holgerferstl.de/PermaLink,guid,5ae50eb8-0e0d-4d6d-acd8-e382743fca7a.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://oldblog.holgerferstl.de/CommentView,guid,5ae50eb8-0e0d-4d6d-acd8-e382743fca7a.aspx</wfw:comment>
      <wfw:commentRss>http://oldblog.holgerferstl.de/SyndicationService.asmx/GetEntryCommentsRss?guid=5ae50eb8-0e0d-4d6d-acd8-e382743fca7a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Question<br /></strong>How to install a .NET usercontrol library in Visual Studio, so that it appears
in the reference list and in the customize toolbox list <strong>without</strong> explicit
add the dll manually?
</p>
        <p align="center">
          <img src="http://oldblog.holgerferstl.de/content/binary/ucivsi.jpg" border="0" />
        </p>
        <p align="center">
 
</p>
        <p align="left">
          <strong>Answer</strong>
          <br />
Just add the path of the dll into the following registry key: <strong><font size="1">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders</font></strong></p>
        <p align="center">
          <img src="http://oldblog.holgerferstl.de/content/binary/registry.jpg" border="0" />
        </p>
        <img width="0" height="0" src="http://oldblog.holgerferstl.de/aggbug.ashx?id=5ae50eb8-0e0d-4d6d-acd8-e382743fca7a" />
      </body>
      <title>visual studio customization</title>
      <guid isPermaLink="false">http://oldblog.holgerferstl.de/PermaLink,guid,5ae50eb8-0e0d-4d6d-acd8-e382743fca7a.aspx</guid>
      <link>http://oldblog.holgerferstl.de/2005/02/22/visualStudioCustomization.aspx</link>
      <pubDate>Tue, 22 Feb 2005 23:19:45 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Question&lt;br&gt;
&lt;/strong&gt;How to install a .NET usercontrol library in Visual Studio, so that it appears
in the reference list and in the customize toolbox list &lt;strong&gt;without&lt;/strong&gt; explicit
add the dll manually?
&lt;/p&gt;
&lt;p align=center&gt;
&lt;img src="http://oldblog.holgerferstl.de/content/binary/ucivsi.jpg" border=0&gt;
&lt;/p&gt;
&lt;p align=center&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p align=left&gt;
&lt;strong&gt;Answer&lt;/strong&gt;
&lt;br&gt;
Just add the path of the dll into the&amp;nbsp;following registry key: &lt;strong&gt;&lt;font size=1&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders&lt;/font&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p align=center&gt;
&lt;img src="http://oldblog.holgerferstl.de/content/binary/registry.jpg" border=0&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://oldblog.holgerferstl.de/aggbug.ashx?id=5ae50eb8-0e0d-4d6d-acd8-e382743fca7a" /&gt;</description>
      <comments>http://oldblog.holgerferstl.de/CommentView,guid,5ae50eb8-0e0d-4d6d-acd8-e382743fca7a.aspx</comments>
      <category>coden</category>
      <category>faq</category>
    </item>
  </channel>
</rss>