<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1847278434515420457</id><updated>2026-03-01T19:44:57.217-08:00</updated><category term="programing world"/><category term="VB.net"/><category term="CSharp"/><category term="visual basic world"/><category term="Process"/><category term="Console"/><category term="Multimedia"/><category term="software world"/><category term="Form"/><category term="Graphics"/><category term="Custom Control"/><category term="TabControl"/><category term="XML"/><category term="internet world"/><category term="java"/><category term="Blogger"/><category term="C++"/><category term="HTML"/><category term="Visual Studio 2010 Tools"/><category term="php"/><category term="Adobe Photoshop"/><category term="DataGridView"/><category term="Database"/><category term="Menu Strip"/><category term="SQL Server"/><category term="Windows"/><category term="3D Max"/><category term="Adobe After Effects"/><category term="Adobe Premiere"/><category term="Article"/><category term="Button"/><category term="ComboBox"/><category term="Panel"/><category term="Slider"/><category term="TextBox"/><category term="TreeView"/><category term="Turbo Pascal"/><category term="Turbo Pascal for Windows"/><category term="Video Editing"/><category term="screen capture"/><category term="string"/><title type='text'>Modern Programming</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default?start-index=26&amp;max-results=25'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>71</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-8927397871879611104</id><published>2014-11-08T21:19:00.000-08:00</published><updated>2014-11-08T21:19:03.476-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHP Apache Virtual Host Manager for XAMPP Windows</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Use this code for adding virtual on your xampp windows sistem.&lt;br /&gt;
&lt;textarea style=&quot;height: 491px; margin: 0px; width: 100%;&quot;&gt;&lt;?php

$vhost_file = &quot;../apache/conf/extra/httpd-vhosts.conf&quot;;
$host_file = &quot;c:\\windows\\system32\\/drivers\\etc\\hosts&quot;;

$template=&lt;&lt;&lt;end
&lt;virtualhost {HOST}:80&gt;
 ServerAdmin admin@{HOST}
 DocumentRoot &quot;{HOST-DIR}&quot;
 ServerName {HOST}
 ServerAlias www.{HOST}
 ErrorLog &quot;logs/{HOST}-error.log&quot;
 CustomLog &quot;logs/{HOST}-access.log&quot; common
&lt;/VirtualHost&gt;
end;

$host_konten = true;

if($_POST){
 $new = str_replace(&#39;{HOST}&#39;, $_POST[&#39;host&#39;], $template);
 $new = str_replace(&#39;{HOST-DIR}&#39;, $_POST[&#39;host-dir&#39;], $new);
 
 if(file_put_contents($vhost_file, &quot;\r\n&quot;.$new,FILE_APPEND)){
  $msg = &#39;OK&#39;;
 }
 $sn = $_POST[&#39;host&#39;];
 $host_add = &quot;\r\n127.0.0.1\t$sn\r\n127.0.0.1\twww.$sn\r\n&quot;;

 $host_konten = file_put_contents($host_file, &quot;\r\n&quot;.$host_add,FILE_APPEND);
  
}

$konten = file_get_contents($vhost_file);
if(!$konten){
 echo &quot;Error: Can&#39;t read vhost_file: $vhost_file.&quot;;
 return;
}
//echo $konten;

?&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
 &lt;title&gt;PHP Apache Virtual Host Manager for XAMPP Windows&lt;/title&gt;
&lt;/head&gt;
&lt;body style=&quot;background: rgb(249, 249, 249);color: rgb(153, 0, 186);font-family: verdana;font-size: medium;margin: 39px;&quot;&gt;
&lt;header&gt;
 &lt;h1&gt;
PHP Apache Virtual Host Manager for XAMPP Windows&lt;/h1&gt;
&lt;p&gt;
please make backup to your vhost.conf file before applying changes.&lt;/p&gt;
&lt;/header&gt;
&lt;article&gt;
 &lt;form method=&quot;post&quot;&gt;
 &lt;?php

 if($msg = &#39;OK&#39;){
  if(!$host_konten){
   echo &quot;&lt;div style=&#39;color:red&#39;&gt;
Can&#39;t modify hosts windows file&lt;/div&gt;
&quot;;
  }
  echo &quot;&lt;h2 style=&#39;color:green&#39;&gt;
vHost Added!.&lt;/h2&gt;
&lt;p&gt;
Now restart your apache&lt;/p&gt;
&lt;hr&gt;
&quot;;
 }
 //$pattern = &#39;/^&lt;VirtualHost\s[\*|a-zA-Z0-9]+\:[0-9]+&gt;(.*)/i&#39;;
 $pattern_open = &#39;/^&lt;virtualhost\s(.*)&gt;/i&#39;;
 $pattern_close = &#39;/^&lt;\/virtualhost&gt;/i&#39;;
 $lines = explode(&quot;\r\n&quot;, $konten);
 $hosts = array();
 $pos = 0;
 $is_open = false;
 foreach ($lines as $key =&gt; $value) {
  $value = trim($value);
  if($is_open){
   if(preg_match($pattern_close, $value)){
    //$hosts[$pos][&#39;close_tag&#39;] = $value;
    $is_open = false;
    $pos++;
   }else{
    $v = explode(&quot; &quot;, $value);
    $hosts[$pos][$v[0]] = $v[1];
   }
  }elseif(preg_match($pattern_open, $value)){
   $is_open = true;
   $hosts[$pos] = array();//&#39;open_tag&#39; =&gt; $value);
  }
 }
 foreach ($hosts as $h) {
  echo &quot;&lt;h3&gt;
$h[ServerName]&lt;/h3&gt;
&quot;;
  echo &#39;&lt;div&gt;
&#39;;
  foreach ($h as $k =&gt; $v) {
   echo &quot;$k : $v&lt;br/&gt;&quot;;

  }
  echo &#39;&lt;/div&gt;
&#39;;
 }
 
 ?&gt;
 &lt;hr&gt;
 &lt;h2&gt;
Add New&lt;/h2&gt;
ServerName: &lt;input type=&quot;text&quot; name=&quot;host&quot; value=&quot;&quot;&gt;&lt;br/&gt;
 DocumentRoot: &lt;input type=&quot;text&quot; name=&quot;host-dir&quot; value=&quot;c:\xampp\htdocs\&quot;&gt;  &lt;br/&gt;
 &lt;input type=&quot;submit&quot; value=&quot;SAVE AND WRITE!&quot;&gt;
 &lt;/form&gt;
&lt;/article&gt;
&lt;hr/&gt;
&lt;footer&gt;
 © 2014 Klampok Child — &lt;a href=&#39;http://developer-id.com/&#39;&gt;Developer-id.com&lt;/a&gt;
&lt;/footer&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/textarea&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/8927397871879611104/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2014/11/php-apache-virtual-host-manager-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/8927397871879611104'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/8927397871879611104'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2014/11/php-apache-virtual-host-manager-for.html' title='PHP Apache Virtual Host Manager for XAMPP Windows'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-1889848396026368706</id><published>2012-06-11T10:13:00.001-07:00</published><updated>2012-06-11T10:15:50.382-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Multimedia"/><category scheme="http://www.blogger.com/atom/ns#" term="Video Editing"/><title type='text'>Best Free Video Editing Software</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Many programs simply don&#39;t do what the manufacturers say that they will do, and others don&#39;t provide enough - or any support.Of course, most free software does not include the same level or quality of support that you would expect to find with software that you purchase commercially.While it is true that you get what you pay for, there really are some good free video editing software available out there.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Here are the top five that we have found:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.microsoft.com/windowsxp/downloads/updates/moviemaker2.mspx&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Microsoft Movie Maker&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span id=&quot;goog_362553401&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_362553402&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEjGHhMBpR6Po0qW6PFTHkNTiadrb0PfLzW1e29bH0xglPCfttfzVb4DHFD8yiPFoTtStBzMY8-x1V6Q2V2g7dYuCh57LxCt1a7LioH68zrLwuKKuA9AnARxivT97BkVMB0XOkmZHrFNE/s1600/top-5-free-video-editing-software-review-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEjGHhMBpR6Po0qW6PFTHkNTiadrb0PfLzW1e29bH0xglPCfttfzVb4DHFD8yiPFoTtStBzMY8-x1V6Q2V2g7dYuCh57LxCt1a7LioH68zrLwuKKuA9AnARxivT97BkVMB0XOkmZHrFNE/s1600/top-5-free-video-editing-software-review-1.jpg&quot; /&gt;&lt;/a&gt;Already installed on newer computers that are running Windows XP, Movie Maker has drag and drop features to make creating and editing your movie easier. Microsoft has many add-ons for this software, and upgrades are available through the website. This is one of the best free video editing software programs available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.apple.com/ilife/imovie/&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Apple iMovie&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvvE9mvjsPmKIWkvrQ4FSHkPd6iIMG1HhskAKyKq_aRbRmZ5GQIlsn08fNn-D8QtS_ZOAl4co8gxg7OjC4QO_pLjCKdzzX0mbIAycKN92zDntf0S6KRgXvqv8xBcz-NpqJS72y3zpXVs4/s1600/top-5-free-video-editing-software-review-2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvvE9mvjsPmKIWkvrQ4FSHkPd6iIMG1HhskAKyKq_aRbRmZ5GQIlsn08fNn-D8QtS_ZOAl4co8gxg7OjC4QO_pLjCKdzzX0mbIAycKN92zDntf0S6KRgXvqv8xBcz-NpqJS72y3zpXVs4/s1600/top-5-free-video-editing-software-review-2.jpg&quot; /&gt;&lt;/a&gt;Apple iMovie is comparable to Windows Movie Maker, but Apple iMovie is used on the Mac operating system. Apple iMovie has many advanced features and add-ons. Unfortunately, the software is only free if you buy a new Mac system. If you want the software without buying the system, it is available for purchase separately. One of the best free video editing programs available for Mac users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.avid.com/freedv/&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Avid FreeDV&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgy0rSNb8s2QsJgAyWPqg8oQI5BWs-EcV7uhNNh2XR-U4rX_XqiiPbDMa86vMhGWsiKYNRvqwqfHPFI4lSwg2V4lDXBkrcZIcZ1pe5uuFu8ruTjk44eFy5zQ1DXXnw-JWy6PaROrpuRP0/s1600/top-5-free-video-editing-software-review-3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgy0rSNb8s2QsJgAyWPqg8oQI5BWs-EcV7uhNNh2XR-U4rX_XqiiPbDMa86vMhGWsiKYNRvqwqfHPFI4lSwg2V4lDXBkrcZIcZ1pe5uuFu8ruTjk44eFy5zQ1DXXnw-JWy6PaROrpuRP0/s1600/top-5-free-video-editing-software-review-3.jpg&quot; /&gt;&lt;/a&gt;Avid FreeDV is available for both Windows and Mac operating systems, and includes basic video and audio editing capabilities, as well as up to two streams of real-time effects. On the whole, a solid video editing program that is slightly hard to use, but very powerful once you learn its ins and outs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.debugmode.com/wax/&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Wax&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAX6vQzKN9xj8GjlgZZxIwQrtwY-RsaVmVNRmwkZepcPvkzI6pD2AJJhlCV1owZ0SHD0I7__Tiur4196SWtebI7I_lE1daNlt8QtN97eZCym7FUkaPnM9dFYQA9FtiYLTGjL9j6B8WAQE/s1600/top-5-free-video-editing-software-review-4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAX6vQzKN9xj8GjlgZZxIwQrtwY-RsaVmVNRmwkZepcPvkzI6pD2AJJhlCV1owZ0SHD0I7__Tiur4196SWtebI7I_lE1daNlt8QtN97eZCym7FUkaPnM9dFYQA9FtiYLTGjL9j6B8WAQE/s1600/top-5-free-video-editing-software-review-4.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Wax is a high performance and flexible free video editing software program. It started out as a college project, and has since grown. Wax is good for both home users and professionals. It can be used as a stand-alone application, or as a plug-in to other video editors. The software also features unlimited video and audio tracks with top-down compositing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.thugsatbay.com/tab/?q=zweistein&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Zwei-Stein&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJejXsdV-Yoeoe75ZNZ1q_qmgT80fRfnQG2MXlrhPwFOOco06yY1a7F4vCh67D1_gvLFk6O5m4DMmn086zVwZ1-V2A8oXNAIRDxdxejIbTur4f97cZ39NKym02ah8GBlFddD-UdcWJNtM/s1600/top-5-free-video-editing-software-review-5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJejXsdV-Yoeoe75ZNZ1q_qmgT80fRfnQG2MXlrhPwFOOco06yY1a7F4vCh67D1_gvLFk6O5m4DMmn086zVwZ1-V2A8oXNAIRDxdxejIbTur4f97cZ39NKym02ah8GBlFddD-UdcWJNtM/s1600/top-5-free-video-editing-software-review-5.jpg&quot; /&gt;&lt;/a&gt;Zwei-Stein is great free video editing software, but the user interface is very technical. It is full featured, offering many different effects. It can edit up to 256 video, audio, and still image clips. There are up to 64 effects, which can be chained serially. An interesting program that&#39;s worth looking at.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/1889848396026368706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/06/best-free-video-editing-software.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1889848396026368706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1889848396026368706'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/06/best-free-video-editing-software.html' title='Best Free Video Editing Software'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEjGHhMBpR6Po0qW6PFTHkNTiadrb0PfLzW1e29bH0xglPCfttfzVb4DHFD8yiPFoTtStBzMY8-x1V6Q2V2g7dYuCh57LxCt1a7LioH68zrLwuKKuA9AnARxivT97BkVMB0XOkmZHrFNE/s72-c/top-5-free-video-editing-software-review-1.jpg" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-6823009335572294622</id><published>2012-06-09T23:50:00.002-07:00</published><updated>2012-06-09T23:50:53.920-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="Visual Studio 2010 Tools"/><title type='text'>Visual Studio Shortcut Keyboard List</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;Navigation&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;3&quot; class=&quot;MsoTableWeb2&quot; style=&quot;border: inset 1.0pt; mso-border-alt: inset windowtext .75pt; mso-border-insideh: .75pt inset windowtext; mso-border-insidev: .75pt inset windowtext; mso-cellspacing: 2.0pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;Ctrl + ]&lt;/strong&gt; &lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Moves the cursor to the matching Closing or Opening brace&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;Ctrl + hyphen&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Moves cursor to its previous position &lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;Shift + F7&lt;/strong&gt; &lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Switch between the Design View and Source View&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;Ctrl + Tab&lt;/strong&gt; &lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Displays the all open files in VS&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;Ctrl + Shift + F&lt;/strong&gt; &lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Find&amp;nbsp;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;F3&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Search Again or continue search&amp;nbsp;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;
&lt;b&gt;Editing&lt;/b&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;3&quot; class=&quot;MsoTableWeb2&quot; style=&quot;border: inset 1.0pt; mso-border-alt: inset windowtext .75pt; mso-border-insideh: .75pt inset windowtext; mso-border-insidev: .75pt inset windowtext; mso-cellspacing: 2.0pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Ctrl + k + c&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Comment a selected line or all selected lines of code&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Ctrl + k + u&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Uncomment a selected line or all selected lines of code&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Ctrl + x, Ctrl + c, Ctrl + v&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Cut, Copy, Paste&lt;/span&gt;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Code Related&lt;/b&gt;&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;3&quot; class=&quot;MsoTableWeb2&quot; style=&quot;border: inset 1.0pt; mso-border-alt: inset windowtext .75pt; mso-border-insideh: .75pt inset windowtext; mso-border-insidev: .75pt inset windowtext; mso-cellspacing: 2.0pt; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 480;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Ctrl +SpaceBar&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Complete word if exist&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Tab (Twice)&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Inserts Code snippet, eg type while and press Tab twice, or type prop and press Tab twice&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Ctrl + Period (.)&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Shows SmartTag menu&amp;nbsp;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;F5&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Start or run the application&amp;nbsp;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;F6 or&amp;nbsp;&lt;/b&gt;&lt;strong style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px; text-align: left;&quot;&gt;Ctrl + Shift + B&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Build the solution&amp;nbsp;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;F9&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Insert or remove breakpoint&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;Ctrl + S&lt;/b&gt;&lt;/div&gt;&lt;/td&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Save&amp;nbsp;&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;strong style=&quot;background-color: white; color: #444444; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Verdana, Arial, Helvetica, sans-serif, Tahoma; font-size: 13px; line-height: 18px;&quot;&gt;Ctrl + Alt + L&lt;/strong&gt;&lt;/div&gt;&lt;/td&gt;&lt;td style=&quot;border: outset 1.0pt; mso-border-alt: outset windowtext .75pt; padding: 0in 5.4pt 0in 5.4pt; width: 221.4pt;&quot; valign=&quot;top&quot; width=&quot;295&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;Open Solution Explorer&lt;/div&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Thank&#39;s for reading&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/6823009335572294622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/06/visual-studio-shortcut-keyboard-list.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6823009335572294622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6823009335572294622'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/06/visual-studio-shortcut-keyboard-list.html' title='Visual Studio Shortcut Keyboard List'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-6562000516709372673</id><published>2012-06-09T23:49:00.000-07:00</published><updated>2012-06-09T23:49:36.129-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Database"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>CSharp ExecuteNonQuery Sample</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;pre&gt;protected void btnSignIn_Click(object sender, EventArgs e)
    {
        string strConnection = ConfigurationManager.ConnectionStrings[&quot;ConnectionString&quot;].ConnectionString;
        string strInsert = &quot;INSERT INTO Users (Username,Password) VALUES(@Username,@Password)&quot;;
        SqlConnection con = new SqlConnection(strConnection);
        SqlCommand cmd = new SqlCommand();
        cmd.Connection = con;
        cmd.CommandType = CommandType.Text;
        cmd.CommandText = strInsert;

        SqlParameter username = new SqlParameter(&quot;@Username&quot;, SqlDbType.VarChar, 50);
        username.Value = txtUserName.Text.Trim().ToString();
        cmd.Parameters.Add(username);

        SqlParameter password = new SqlParameter(&quot;@Password&quot;, SqlDbType.VarChar, 50);
        password.Value = txtPassword.Text.Trim().ToString();
        cmd.Parameters.Add(password);&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;

        con.Open();
        int result = cmd.ExecuteNonQuery();
       
        con.Close();
    }&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/6562000516709372673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/06/csharp-executenonquery-sample.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6562000516709372673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6562000516709372673'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/06/csharp-executenonquery-sample.html' title='CSharp ExecuteNonQuery Sample'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-1588859473815087905</id><published>2012-06-09T23:43:00.002-07:00</published><updated>2012-06-09T23:43:55.028-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="3D Max"/><category scheme="http://www.blogger.com/atom/ns#" term="Multimedia"/><title type='text'>3D Max Shortcut Keyboard List</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b&gt;3D Studio Max Keyboard shortcuts.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Snaps Action Table :&lt;br /&gt;
Snap To Edge/Segment Toggle : Alt+F10&lt;br /&gt;
Snap To Endpoint Toggle : Alt+F8&lt;br /&gt;
Snap To Face Toggle : Alt+F11&lt;br /&gt;
Snap To Grid Points Toggle : Alt+F5&lt;br /&gt;
Snap To Midpoint Toggle : Alt+F9&lt;br /&gt;
Snap To Pivot Toggle : Alt+F6&lt;br /&gt;
Snap To Vertex Toggle : Alt+F7&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Main UI :&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Adaptive Degradation Toggle : O&lt;br /&gt;
Align : Alt+A&lt;br /&gt;
Angle Snap Toggle : A&lt;br /&gt;
Arc Rotate View Mode : Ctrl+R&lt;br /&gt;
Auto Key Mode Toggle : N&lt;br /&gt;
Background Lock Toggle : Alt+Ctrl+B&lt;br /&gt;
Backup Time One Unit : ,&lt;br /&gt;
Bottom View : B&lt;br /&gt;
Camera View : C&lt;br /&gt;
Clone : Ctrl+V&lt;br /&gt;
Cycle Active Snap Type : Alt+S&lt;br /&gt;
Cycle Selection Method : Ctrl+F&lt;br /&gt;
Cycle Snap Hit : Alt+Shift+S&lt;br /&gt;
Default Lighting Toggle : Ctrl+L&lt;br /&gt;
Delete Objects : .&lt;br /&gt;
Disable Viewport : D&lt;br /&gt;
Display as See-Through Toggle : Alt+X&lt;br /&gt;
Environment Dialog Toggle : 8&lt;br /&gt;
Expert Mode Toggle : Ctrl+X&lt;br /&gt;
Fetch : Alt+Ctrl+F&lt;br /&gt;
Forward Time One Unit : .&lt;br /&gt;
Front View : F&lt;br /&gt;
Go to End Frame : End&lt;br /&gt;
Go to Start Frame : Home&lt;br /&gt;
Hide Cameras Toggle : Shift+C&lt;br /&gt;
Hide Geometry Toggle : Shift+G&lt;br /&gt;
Hide Grids Toggle : G&lt;br /&gt;
Hide Helpers Toggle : Shift+H&lt;br /&gt;
Hide Lights Toggle : Shift+L&lt;br /&gt;
Hide Particle Systems Toggle : Shift+P&lt;br /&gt;
Hide Shapes Toggle : Shift+S&lt;br /&gt;
Hide Space Warps Toggle : Shift+W&lt;br /&gt;
Hold : Alt+Ctrl+H&lt;br /&gt;
Isometric User View : U&lt;br /&gt;
Left View : L&lt;br /&gt;
Lock User Interface Toggle : Alt+0&lt;br /&gt;
Material Editor Toggle : M&lt;br /&gt;
Maximize Viewport Toggle : Alt+W&lt;br /&gt;
MAXScript Listener : F11&lt;br /&gt;
New Scene : Ctrl+N&lt;br /&gt;
Normal Align : Alt+N&lt;br /&gt;
Open File : Ctrl+O&lt;br /&gt;
Pan View : Ctrl+P&lt;br /&gt;
Pan Viewport : I&lt;br /&gt;
Percent Snap Toggle : Shift+Ctrl+P&lt;br /&gt;
Perspective User View : P&lt;br /&gt;
Place Highlight : Ctrl+H&lt;br /&gt;
Play Animation : /&lt;br /&gt;
Quick Align : Shift+A&lt;br /&gt;
Quick Render : Shift+Q&lt;br /&gt;
Redo Scene Operation : Ctrl+Y&lt;br /&gt;
Redo Viewport Operation : Shift+Y&lt;br /&gt;
Redraw All Views : `&lt;br /&gt;
Render Last : F9&lt;br /&gt;
Render Scene Dialog Toggle : F10&lt;br /&gt;
Restrict Plane Cycle : F8&lt;br /&gt;
Restrict to X : F5&lt;br /&gt;
Restrict to Y : F6&lt;br /&gt;
Restrict to Z : F7&lt;br /&gt;
Save File : Ctrl+S&lt;br /&gt;
Scale Cycle : Ctrl+E&lt;br /&gt;
Select All : Ctrl+A&lt;br /&gt;
Select Ancestor : PageUp&lt;br /&gt;
Select and Move : W&lt;br /&gt;
Select and Rotate : E&lt;br /&gt;
Select By Name : H&lt;br /&gt;
Select Child : PageDown&lt;br /&gt;
Select Children : Ctrl+PageDown&lt;br /&gt;
Select Invert : Ctrl+I&lt;br /&gt;
Select None : Ctrl+D&lt;br /&gt;
Selection Lock Toggle : Space&lt;br /&gt;
Set Key Mode : &#39;&lt;br /&gt;
Set Keys : K&lt;br /&gt;
Shade Selected Faces Toggle : F2&lt;br /&gt;
Show Floating Dialogs : Ctrl+`&lt;br /&gt;
Show Main Toolbar Toggle : Alt+6&lt;br /&gt;
Show Safeframes Toggle : Shift+F&lt;br /&gt;
Show Selection Bracket Toggle : J&lt;br /&gt;
Snap To Frozen Objects Toggle : Alt+F2&lt;br /&gt;
Snaps Toggle : S&lt;br /&gt;
Snaps Use Axis Constraints Toggle : Alt+D, Alt+F3&lt;br /&gt;
Sound Toggle : \&lt;br /&gt;
Spacing Tool : Shift+I&lt;br /&gt;
Spot/Directional Light View : Shift+4&lt;br /&gt;
Sub-object Level Cycle : Insert&lt;br /&gt;
Sub-object Selection Toggle : Ctrl+B&lt;br /&gt;
Top View : T&lt;br /&gt;
Transform Gizmo Size Down : -&lt;br /&gt;
Transform Gizmo Size Up : =&lt;br /&gt;
Transform Gizmo Toggle : X&lt;br /&gt;
Transform Type-In Dialog Toggle : F12&lt;br /&gt;
Undo Scene Operation : Ctrl+Z&lt;br /&gt;
Undo Viewport Operation : Shift+Z&lt;br /&gt;
Update Background Image : Alt+Shift+Ctrl+B&lt;br /&gt;
View Edged Faces Toggle : F4&lt;br /&gt;
Viewport Background : Alt+B&lt;br /&gt;
Virtual Viewport Pan Down : NumPad 2&lt;br /&gt;
Virtual Viewport Pan Left : NumPad 4&lt;br /&gt;
Virtual Viewport Pan Right : NumPad 6&lt;br /&gt;
Virtual Viewport Pan Up : NumPad 8&lt;br /&gt;
Virtual Viewport Toggle : NumPad /&lt;br /&gt;
Virtual Viewport Zoom In : NumPad +&lt;br /&gt;
Virtual Viewport Zoom Out : NumPad -&lt;br /&gt;
Wireframe / Smooth+Highlights Toggle : F3&lt;br /&gt;
Zoom Extents All Selected : Z&lt;br /&gt;
Zoom Extents All : Shift+Ctrl+Z&lt;br /&gt;
Zoom Extents : Alt+Ctrl+Z&lt;br /&gt;
Zoom In 2X : Alt+Shift+Ctrl+Z&lt;br /&gt;
Zoom Mode : Alt+Z&lt;br /&gt;
Zoom Out 2X : Alt+Shift+Z&lt;br /&gt;
Zoom Region Mode : Ctrl+W&lt;br /&gt;
Zoom Viewport In : [, Ctrl+=&lt;br /&gt;
Zoom Viewport Out : ], Ctrl+-&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Track View:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Add Keys : A&lt;br /&gt;
Apply Ease Curve : Ctrl+E&lt;br /&gt;
Apply Multiplier Curve : Ctrl+M&lt;br /&gt;
Assign Controller : C&lt;br /&gt;
Copy Controller : Ctrl+C&lt;br /&gt;
Expand Object Toggle : O&lt;br /&gt;
Expand Track Toggle : Enter, T&lt;br /&gt;
Filters : Q&lt;br /&gt;
Lock Selection : Space&lt;br /&gt;
Lock Tangents Toggle : L&lt;br /&gt;
Make Controller Unique : U&lt;br /&gt;
Move Highlight Down : Down Arrow&lt;br /&gt;
Move Highlight Up : Up Arrow&lt;br /&gt;
Move Keys : M&lt;br /&gt;
Nudge Keys Left : Left Arrow&lt;br /&gt;
Nudge Keys Right : Right Arrow&lt;br /&gt;
Pan : P&lt;br /&gt;
Paste Controller : Ctrl+V&lt;br /&gt;
Scroll Down : Ctrl+Down Arrow&lt;br /&gt;
Scroll Up : Ctrl+Up Arrow&lt;br /&gt;
Snap Frames : S&lt;br /&gt;
Zoom : Z&lt;br /&gt;
Zoom Hrizontal Extents Keys : Alt+X&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/1588859473815087905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/06/3d-max-shortcut-keyboard-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1588859473815087905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1588859473815087905'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/06/3d-max-shortcut-keyboard-list.html' title='3D Max Shortcut Keyboard List'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-3214803406603548712</id><published>2012-06-07T23:15:00.000-07:00</published><updated>2012-06-07T23:15:51.381-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>CSharp Create PrintPreview Dialog</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj59Wfj0nv4n80CYaa4lvG-LQ4OmTWAko-qHC18Gry6c-4-Vs3LYlEiZR6gELaPQX83aYQDPiE_Z3HHEwTVuL3NLdMAZHoqA2wH85XYh1yqshrTwzV6BLzPOBQu5QkUFAPhPCtWwDGB4ik/s1600/printpreviewdialogwindowsforms.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj59Wfj0nv4n80CYaa4lvG-LQ4OmTWAko-qHC18Gry6c-4-Vs3LYlEiZR6gELaPQX83aYQDPiE_Z3HHEwTVuL3NLdMAZHoqA2wH85XYh1yqshrTwzV6BLzPOBQu5QkUFAPhPCtWwDGB4ik/s1600/printpreviewdialogwindowsforms.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
this post will explaining how to use printpreviewdialog with C# to preview before printing datagridview in windows forms application.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Drag and place one printPreviewDialog control on the page, open it&#39;s property window and assign document to be previewed (printdocument1) to it&#39;s document property or assign it in code behind.&lt;br /&gt;
&lt;br /&gt;
you can go to link mentioned above to know how to create printdocument.&lt;br /&gt;
&lt;b&gt;Code:&lt;/b&gt; &lt;br /&gt;
&lt;pre&gt;private void btnPrint_Click(object sender, EventArgs e)
        {
            //Assign printPreviewDialog properties
            pvDialog.Document = printDocument1;
            pvDialog.PrintPreviewControl.Zoom = 1;
            pvDialog.ShowDialog();
        }

        private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            Bitmap dataGridViewImage = new Bitmap(this.dataGridView1.Width, this.dataGridView1.Height);
            dataGridView1.DrawToBitmap(dataGridViewImage, new Rectangle(0, 0, this.dataGridView1.Width, this.dataGridView1.Height));
            e.Graphics.DrawImage(dataGridViewImage, 0, 0);
        }&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://www.box.com/s/mhckeuyevjeanhn9mpfc&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;DOWNLOAD SAMPLE PROGRAM&lt;/b&gt; &lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/3214803406603548712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/06/csharp-create-printpreview-dialog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/3214803406603548712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/3214803406603548712'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/06/csharp-create-printpreview-dialog.html' title='CSharp Create PrintPreview Dialog'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj59Wfj0nv4n80CYaa4lvG-LQ4OmTWAko-qHC18Gry6c-4-Vs3LYlEiZR6gELaPQX83aYQDPiE_Z3HHEwTVuL3NLdMAZHoqA2wH85XYh1yqshrTwzV6BLzPOBQu5QkUFAPhPCtWwDGB4ik/s72-c/printpreviewdialogwindowsforms.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-8477865614372167377</id><published>2012-04-19T09:13:00.000-07:00</published><updated>2012-04-19T09:13:00.289-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Process"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><category scheme="http://www.blogger.com/atom/ns#" term="visual basic world"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>haarcascade porn and breast detection</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I have two haarcascade for nude image detection, first is for breast detection, and for porn (nude) image detection. &lt;br /&gt;
Haarcascade for porn image detection, accuarate just 40%-50%, still have many false detection, but you can use for detecting a nude image. created by Indonesian people.&lt;br /&gt;
And haarcascade for breast detection, it have 70%-80% accuration. i don&#39;t know who made it, but i got it from Hackchina source code search engine.&lt;br /&gt;
now you can make your OpenCV to detecting a nude image by using this haarcascades. but you need for create a skin color detection algorithm for make detection more accurate! i will share for skin color detection algorithm in the next moment.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
DOWNLOAD &lt;a href=&quot;http://download.kr3w.de/get_HaarCascade_BREAST_PORN.rar&quot; target=&quot;_blank&quot;&gt;HAARCASCADE PORN AND BREAST&lt;/a&gt; DETECTION&lt;/div&gt;
&lt;br /&gt;
I have make an application to detecting an blocking porn content, you can see this &lt;a href=&quot;http://spd.coolpage.biz/&quot;&gt;http://spd.coolpage.biz&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/8477865614372167377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/04/haarcascade-porn-and-breast-detection.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/8477865614372167377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/8477865614372167377'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/04/haarcascade-porn-and-breast-detection.html' title='haarcascade porn and breast detection'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-6205174225459935413</id><published>2012-03-11T09:56:00.001-07:00</published><updated>2012-03-11T09:57:13.323-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="software world"/><title type='text'>Netbeans Slow When starting</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
I using : Netbeans 7.1&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
OS : win 7 32 Ultimate&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
CPU: core-i5&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
RAM: 2G&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
VGA: 4G&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
I dont know why my Netbeans its running slow when started, make my cursor slow too.&lt;/div&gt;
&lt;br /&gt;
Then I know why, its may a Netbeans bug. Netbeans / Java have some speed problems where implementing fonts from the OS manchine.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;its simple, try to restore Font &amp;amp; color setting in your nertbeans, then restart.. may its done..,&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/6205174225459935413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/03/netbeans-slow-when-starting.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6205174225459935413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6205174225459935413'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/03/netbeans-slow-when-starting.html' title='Netbeans Slow When starting'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-225128963238605865</id><published>2012-02-11T07:57:00.000-08:00</published><updated>2012-02-11T07:57:51.888-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Console"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Process"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><title type='text'>Java Execute Console Process and Get Output</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To execute process you can use ProcessBuilder, like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;ProcessBuilder pb = new ProcessBuilder(&quot;tasklist&quot;).redirectErrorStream(true);&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;i&gt;use redirectErrorStream to make the BufferedReader can read if error message is returned.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Now, get the Process by executing it: &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Process p = pb.start();&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&amp;nbsp; &lt;/code&gt;&lt;/pre&gt;
Then make a BufferedReader that can read the console output screen: &lt;br /&gt;
&lt;code&gt;BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
You can read the respond of console process by using while loop like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;while((str = br.readLine()) != null){
    retVal += str;
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Here is the complete java function:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
public static String run(String cmd) {
        String retVal = &quot;&quot;;
        try {
            ProcessBuilder pb = new ProcessBuilder(cmd).redirectErrorStream(true);
            Process p = pb.start();
            BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String str;
            while((str = br.readLine()) != null){
                retVal += str;
            }
        } catch (IOException ex) {
            retVal = ex.getMessage();
        }
        return retVal;
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/225128963238605865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2012/02/java-execute-console-process-and-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/225128963238605865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/225128963238605865'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2012/02/java-execute-console-process-and-get.html' title='Java Execute Console Process and Get Output'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-4083182943499259895</id><published>2011-10-25T07:49:00.000-07:00</published><updated>2011-10-25T07:49:13.365-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>DOM XPath Syntax</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;




This The Content of XML File&lt;/h3&gt;
&lt;textarea style=&quot;height: 250px; width: 100%;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;

&amp;lt;bookstore&amp;gt;

&amp;lt;book&amp;gt;
  &amp;lt;title lang=&quot;eng&quot;&amp;gt;Harry Potter&amp;lt;/title&amp;gt;
  &amp;lt;price&amp;gt;29.99&amp;lt;/price&amp;gt;
&amp;lt;/book&amp;gt;

&amp;lt;book&amp;gt;
  &amp;lt;title lang=&quot;eng&quot;&amp;gt;Learning XML&amp;lt;/title&amp;gt;
  &amp;lt;price&amp;gt;39.95&amp;lt;/price&amp;gt;
&amp;lt;/book&amp;gt;

&amp;lt;/bookstore&amp;gt;&amp;nbsp;&lt;/textarea&gt;&lt;br /&gt;
&lt;h2&gt;
Selecting Nodes&lt;/h2&gt;
XPath uses path expressions to select nodes in an XML document. The node is selected by following a path or steps. 
The most useful 
path expressions are listed below:&lt;br /&gt;

&lt;table class=&quot;reference&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
 &lt;th align=&quot;left&quot; valign=&quot;top&quot; width=&quot;25%&quot;&gt;Expression&lt;/th&gt;
    &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Description&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;&lt;i&gt;nodename&lt;/i&gt;&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all child nodes of the named node&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects from the root node&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects nodes in the document from the current node that 
 match the selection no matter where they are &lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;.&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the current node&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;..&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the parent of the current node&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;@&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects attributes&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
In the table below we have listed some path expressions and the result of the 
expressions:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;

&lt;table class=&quot;reference&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
 &lt;th align=&quot;left&quot; valign=&quot;top&quot; width=&quot;25%&quot;&gt;Path Expression&lt;/th&gt;
    &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Result&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;bookstore&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the child nodes of the bookstore element&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the root element bookstore&lt;b&gt;Note:&lt;/b&gt; If the path starts with a slash ( / ) it 
 always represents an absolute 
path to an element!&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;bookstore/book&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all book elements that are children of bookstore&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//book&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all book elements no matter where they are in the 
 document&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;bookstore//book&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all book elements that are descendant of the 
 bookstore element, no matter where they are under the bookstore element&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//@lang&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all attributes that are named lang&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;hr /&gt;


&lt;h2&gt;
Predicates&lt;/h2&gt;
Predicates are used to find a specific node or a node that contains a specific value.&lt;br /&gt;

Predicates are always embedded in square brackets.&lt;br /&gt;


In the table below we have listed some path expressions with predicates and the result of the 
expressions:&lt;br /&gt;

&lt;table class=&quot;reference&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
 &lt;th align=&quot;left&quot; valign=&quot;top&quot; width=&quot;40%&quot;&gt;Path Expression&lt;/th&gt;
    &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Result&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book[1] &lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the first book element that is the child of the 
 bookstore element.&lt;b&gt;Note:&lt;/b&gt; IE5 and later has implemented that [0] should be the first node, 
but according to the W3C standard it should have been [1]!!&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book[last()]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the last book element that is the child of the 
 bookstore element&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book[last()-1]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the last but one book element that is the child of the 
 bookstore element&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book[position()&amp;lt;3]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects the first two book elements that are children of the 
 bookstore element&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//title[@lang]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the title elements that have an attribute named 
 lang&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//title[@lang=&#39;eng&#39;]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the title elements that have an attribute named lang 
 with a value of &#39;eng&#39;&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book[price&amp;gt;35.00]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the book elements of the bookstore element that 
 have a price element with a value greater than 35.00&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book[price&amp;gt;35.00]/title&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the title elements of the book elements of the 
 bookstore element that have a price element with a value greater than 35.00&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;hr /&gt;


&lt;h2&gt;
Selecting Unknown Nodes&lt;/h2&gt;
XPath wildcards can be used to select unknown XML elements.&lt;br /&gt;

&lt;table class=&quot;reference&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
 &lt;th align=&quot;left&quot; valign=&quot;top&quot; width=&quot;25%&quot;&gt;Wildcard&lt;/th&gt;
    &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Description&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;*&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Matches any element node&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;@*&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Matches any attribute node&lt;/td&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;node()&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Matches any node of any kind&lt;/td&gt;
    &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
In the table below we have listed some path expressions and the result of the 
expressions:&lt;br /&gt;

&lt;table class=&quot;reference&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
 &lt;th align=&quot;left&quot; valign=&quot;top&quot; width=&quot;25%&quot;&gt;Path Expression&lt;/th&gt;
    &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Result&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/*&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the child nodes of the bookstore element&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//*&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all elements in the document&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//title[@*]&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all title elements which have any attribute&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;hr /&gt;


&lt;h2&gt;
Selecting Several Paths&lt;/h2&gt;
By using the | operator in an XPath expression you can select several paths.&lt;br /&gt;


In the table below we have listed some path expressions and the result of the 
expressions:&lt;br /&gt;

&lt;table class=&quot;reference&quot;&gt;
  &lt;tbody&gt;
&lt;tr&gt;
 &lt;th align=&quot;left&quot; valign=&quot;top&quot; width=&quot;40%&quot;&gt;Path Expression&lt;/th&gt;
    &lt;th align=&quot;left&quot; valign=&quot;top&quot;&gt;Result&lt;/th&gt;
  &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//book/title | //book/price&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the title AND price elements of all book 
 elements&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;//title | //price&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the title AND price elements in the document&lt;/td&gt;
    &lt;/tr&gt;
&lt;tr&gt;
    &lt;td valign=&quot;top&quot;&gt;/bookstore/book/title | //price&lt;/td&gt;
    &lt;td valign=&quot;top&quot;&gt;Selects all the title elements of the book element of the 
 bookstore element AND all the price elements in the document&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/4083182943499259895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/10/dom-xpath-syntax.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/4083182943499259895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/4083182943499259895'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/10/dom-xpath-syntax.html' title='DOM XPath Syntax'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-5782860968632393825</id><published>2011-09-23T22:16:00.000-07:00</published><updated>2011-09-23T22:16:59.317-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="XML"/><title type='text'>Easy Way Convert HTML to XML in PHP DOMdocument</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;You know that this tag &lt;span style=&quot;background-color: white; color: #20124d; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;img src=&quot;xxx.jpg&quot; /&gt;&lt;/span&gt; is not valid for XML DOM Document. if you will to load content from HTML page and you need to convert it to XML this img tag will be a big trouble. Let me to fix this problem.&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;See this sample code and you will understand how I can do it :-)&lt;/span&gt;&lt;/div&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;!--?php&lt;/p--&gt;&lt;/div&gt;&lt;div style=&quot;color: #20124d; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;$ret = &#39;&lt;img src=&quot;xxx.jpg&quot; /&gt;&#39;;&lt;br /&gt;
$x = new DOMDocument;&lt;br /&gt;
$x-&amp;gt;loadHTML($ret);&lt;br /&gt;
$x-&amp;gt;loadXML($x-&amp;gt;saveXML());&lt;br /&gt;
echo $x-&amp;gt;childNodes-&amp;gt;item(1)-&amp;gt;childNodes-&amp;gt;item(0)-&amp;gt;childNodes-&amp;gt;item(0)-&amp;gt;getAttribute(&#39;src&#39;);&lt;/div&gt;&lt;span style=&quot;color: #20124d; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
$ret is the HTML text source&lt;br /&gt;
this code is shown how to converting HTML to XML using PHP DOMdocument class.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/5782860968632393825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/09/easy-way-convert-html-to-xml-in-php.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/5782860968632393825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/5782860968632393825'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/09/easy-way-convert-html-to-xml-in-php.html' title='Easy Way Convert HTML to XML in PHP DOMdocument'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-6502457788536595508</id><published>2011-08-14T07:42:00.000-07:00</published><updated>2011-08-14T07:42:11.136-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><title type='text'>HTML Escape Character Table</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Maybe some developer was know about HTML escape string, but, they can&#39;t remember one by one about HTML escape character.. Then, maybe this HTML escape character tables will be your HTML refference:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;table align=&quot;&quot; border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;&lt;thead&gt;
&lt;tr&gt; &lt;th colspan=&quot;4&quot;&gt;HTML Escape Characters&lt;/th&gt; &lt;/tr&gt;
&lt;/thead&gt; &lt;tbody&gt;
&lt;tr class=&quot;top&quot;&gt; &lt;td&gt;&lt;i&gt;Decimal Value (&amp;amp;#DV;)&lt;/i&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Escape Character&lt;/i&gt;&lt;/td&gt; &lt;td&gt;&lt;i&gt;Output&lt;/i&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;0 - 031&lt;/td&gt; &lt;td&gt;None&lt;/td&gt; &lt;td&gt;Nothing&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;032&lt;/td&gt; &lt;td&gt;&amp;amp;sp; or &amp;amp;blank;&lt;/td&gt; &lt;td&gt;Blank&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;033&lt;/td&gt; &lt;td&gt;&amp;amp;excl;&lt;/td&gt; &lt;td&gt;!&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;034&lt;/td&gt; &lt;td&gt;&amp;amp;quot;&lt;/td&gt; &lt;td&gt;&quot;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;035&lt;/td&gt; &lt;td&gt;&amp;amp;num;&lt;/td&gt; &lt;td&gt;#&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;036&lt;/td&gt; &lt;td&gt;&amp;amp;dollar;&lt;/td&gt; &lt;td&gt;$&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;037&lt;/td&gt; &lt;td&gt;&amp;amp;percnt;&lt;/td&gt; &lt;td&gt;%&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;038&lt;/td&gt; &lt;td&gt;&amp;amp;amp;&lt;/td&gt; &lt;td&gt;&amp;amp;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;039&lt;/td&gt;  &lt;td&gt;&amp;amp;apos;&lt;/td&gt; &lt;td&gt;&#39;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;040&lt;/td&gt; &lt;td&gt;&amp;amp;lpar;&lt;/td&gt; &lt;td&gt;(&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;041&lt;/td&gt; &lt;td&gt;&amp;amp;rpar;&lt;/td&gt;  &lt;td&gt;)&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;042&lt;/td&gt; &lt;td&gt;&amp;amp;ast;&lt;/td&gt; &lt;td&gt;*&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;043&lt;/td&gt; &lt;td&gt;&amp;amp;plus;&lt;/td&gt; &lt;td&gt;+&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;044&lt;/td&gt; &lt;td&gt;&amp;amp;comma;&lt;/td&gt; &lt;td&gt;,&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;045&lt;/td&gt; &lt;td&gt;&amp;amp;hyphen; or − or &amp;amp;dash;&lt;/td&gt; &lt;td&gt;-&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;046&lt;/td&gt; &lt;td&gt;&amp;amp;period;&lt;/td&gt; &lt;td&gt;.&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;047&lt;/td&gt; &lt;td&gt;&amp;amp;sol;&lt;/td&gt; &lt;td&gt;/&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td colspan=&quot;3&quot;&gt;048-057 = digits 0-9&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;058&lt;/td&gt; &lt;td&gt;&amp;amp;colon;&lt;/td&gt; &lt;td&gt;:&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;059&lt;/td&gt; &lt;td&gt;&amp;amp;semi;&lt;/td&gt;  &lt;td&gt;;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;060&lt;/td&gt; &lt;td&gt;&amp;lt;&lt;/td&gt; &lt;td&gt;&amp;lt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;061&lt;/td&gt; &lt;td&gt;&amp;amp;equals;&lt;/td&gt; &lt;td&gt;=&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;062&lt;/td&gt; &lt;td&gt;&amp;gt;&lt;/td&gt; &lt;td&gt;&amp;gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;063&lt;/td&gt; &lt;td&gt;&amp;amp;quest;&lt;/td&gt; &lt;td&gt;?&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;064&lt;/td&gt;  &lt;td&gt;&amp;amp;commat;&lt;/td&gt; &lt;td&gt;@&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td colspan=&quot;3&quot;&gt;065 - 090 = letters A - Z&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;091&lt;/td&gt; &lt;td&gt;&amp;amp;lsqb;&lt;/td&gt; &lt;td&gt;[&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;092&lt;/td&gt; &lt;td&gt;&amp;amp;bsol;&lt;/td&gt; &lt;td&gt;\&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;093&lt;/td&gt; &lt;td&gt;&amp;amp;rsqb;&lt;/td&gt; &lt;td&gt;]&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;094&lt;/td&gt; &lt;td&gt;ˆ or &amp;amp;caret;&lt;/td&gt; &lt;td&gt;^&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;095&lt;/td&gt; &lt;td&gt;&amp;amp;lowbar;&lt;/td&gt; &lt;td&gt;_&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;096&lt;/td&gt; &lt;td&gt;None (grave accent/back apostrophe)&lt;/td&gt; &lt;td&gt;`&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td colspan=&quot;3&quot;&gt;097 - 122 = letters a - z&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;123&lt;/td&gt; &lt;td&gt;&amp;amp;lcub;&lt;/td&gt; &lt;td&gt;{&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;124&lt;/td&gt; &lt;td&gt;&amp;amp;verbar;&lt;/td&gt; &lt;td&gt;|&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;125&lt;/td&gt; &lt;td&gt;&amp;amp;rcub;&lt;/td&gt; &lt;td&gt;}&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;126&lt;/td&gt; &lt;td&gt;&amp;amp;tilde; or &amp;amp;sim;&lt;/td&gt; &lt;td&gt;~&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;127&lt;/td&gt; &lt;td&gt;None (delete)&lt;/td&gt; &lt;td&gt;None&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td colspan=&quot;3&quot;&gt;128 - 159 = unused (MS specific)&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;160&lt;/td&gt; &lt;td&gt;&amp;amp;nbsp;&lt;/td&gt; &lt;td&gt;non-breaking space&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;161&lt;/td&gt; &lt;td&gt;&amp;amp;iexcl;&lt;/td&gt;  &lt;td&gt;¡&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;162&lt;/td&gt; &lt;td&gt;&amp;amp;cent;&lt;/td&gt; &lt;td&gt;¢&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;163&lt;/td&gt; &lt;td&gt;&amp;amp;pound;&lt;/td&gt; &lt;td&gt;£&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;164&lt;/td&gt; &lt;td&gt;&amp;amp;curren;&lt;/td&gt; &lt;td&gt;¤&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;165&lt;/td&gt; &lt;td&gt;&amp;amp;yen;&lt;/td&gt; &lt;td&gt;¥&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;166&lt;/td&gt; &lt;td&gt;&amp;amp;brvbar; or &amp;amp;brkbar;&lt;/td&gt; &lt;td&gt;¦&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;167&lt;/td&gt; &lt;td&gt;&amp;amp;sect;&lt;/td&gt; &lt;td&gt;§&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;168&lt;/td&gt; &lt;td&gt;&amp;amp;uml; or &amp;amp;die;&lt;/td&gt; &lt;td&gt;¨&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;169&lt;/td&gt; &lt;td&gt;&amp;amp;copy;&lt;/td&gt; &lt;td&gt;©&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;170&lt;/td&gt; &lt;td&gt;&amp;amp;ordf;&lt;/td&gt; &lt;td&gt;ª&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;171&lt;/td&gt; &lt;td&gt;&amp;amp;laquo;&lt;/td&gt; &lt;td&gt;«&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;172&lt;/td&gt; &lt;td&gt;&amp;amp;not;&lt;/td&gt; &lt;td&gt;¬&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;173&lt;/td&gt; &lt;td&gt;&amp;amp;shy; (soft hyphen)&lt;/td&gt; &lt;td&gt;None&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;174&lt;/td&gt;  &lt;td&gt;&amp;amp;reg;&lt;/td&gt; &lt;td&gt;®&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;175&lt;/td&gt; &lt;td&gt;&amp;amp;macr; or &amp;amp;hibar;&lt;/td&gt; &lt;td&gt;¯&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;176&lt;/td&gt;  &lt;td&gt;&amp;amp;deg;&lt;/td&gt; &lt;td&gt;°&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;177&lt;/td&gt; &lt;td&gt;&amp;amp;plusmn;&lt;/td&gt; &lt;td&gt;±&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;178&lt;/td&gt; &lt;td&gt;&amp;amp;sup2;&lt;/td&gt;  &lt;td&gt;²&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;179&lt;/td&gt; &lt;td&gt;&amp;amp;sup3;&lt;/td&gt; &lt;td&gt;³&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;180&lt;/td&gt; &lt;td&gt;&amp;amp;acute;&lt;/td&gt; &lt;td&gt;´&lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;181&lt;/td&gt; &lt;td&gt;&amp;amp;micro;&lt;/td&gt; &lt;td&gt;µ&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;182&lt;/td&gt; &lt;td&gt;&amp;amp;para;&lt;/td&gt; &lt;td&gt;¶&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;183&lt;/td&gt; &lt;td&gt;&amp;amp;middot;&lt;/td&gt; &lt;td&gt;·&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;184&lt;/td&gt; &lt;td&gt;&amp;amp;cedil;&lt;/td&gt; &lt;td&gt;¸&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;  &lt;td&gt;185&lt;/td&gt; &lt;td&gt;&amp;amp;sup1;&lt;/td&gt; &lt;td&gt;¹&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;186&lt;/td&gt; &lt;td&gt;&amp;amp;ordm;&lt;/td&gt; &lt;td&gt;º&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;187&lt;/td&gt;  &lt;td&gt;&amp;amp;raquo;&lt;/td&gt; &lt;td&gt;»&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;188&lt;/td&gt; &lt;td&gt;&amp;amp;frac14;&lt;/td&gt; &lt;td&gt;¼&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;189&lt;/td&gt; &lt;td&gt;&amp;amp;frac12; or &amp;amp;half;&lt;/td&gt;  &lt;td&gt;½&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;190&lt;/td&gt; &lt;td&gt;&amp;amp;frac34;&lt;/td&gt; &lt;td&gt;¾&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;191&lt;/td&gt; &lt;td&gt;&amp;amp;iquest;&lt;/td&gt; &lt;td&gt;¿&lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/6502457788536595508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/08/maybe-some-developer-was-know-about.html#comment-form' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6502457788536595508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6502457788536595508'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/08/maybe-some-developer-was-know-about.html' title='HTML Escape Character Table'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-1201982508636672838</id><published>2011-08-09T15:30:00.000-07:00</published><updated>2011-08-09T15:30:04.390-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><title type='text'>Share Url HTML Code for Blogger (Social Bookmarking)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Bibsonomy&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.bibsonomy.org/ShowBookmarkEntry?c=b&amp;amp;jump=yes&amp;amp;url=[URL]&amp;amp;description=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Blogmarks&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://blogmarks.net/my/new.php? title=[TEXT TITLE]&amp;amp;url=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Blinklist&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;amp;Url=[URL]&amp;amp;Title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Delicious&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://delicious.com/post?url=[URL]&amp;amp;title=[TEXT TITLE]¬es=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Design Bump&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.designbump.com/submit?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Design Float&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.designfloat.com/submit.php?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Design Moo&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.designmoo.com/submit?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Digg&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://digg.com/submit?phase=2&amp;amp;url=[URL]&amp;amp;title=[TEXT TITLE]&amp;amp;bodytext=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Diigo&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.diigo.com/post?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Dzone&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.dzone.com/links/add.html?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Facebook&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.facebook.com/share.php?u=[URL]&amp;amp;t=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Fark&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://cgi.fark.com/cgi/fark/farkit.pl?h=[TEXT TITLE]&amp;amp;u=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Friendfeed&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.friendfeed.com/share?title=[TEXT TITLE]&amp;amp;link=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Folkd&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.folkd.com/submit/[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Google Bookmarks&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.google.com/bookmarks/mark?op=edit&amp;amp;bkmk=[URL]&amp;amp;title=[TEXT TITLE]&amp;amp;annotation=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Hacker News&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://news.ycombinator.com/submitlink?u=[URL]&amp;amp;t=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;HaoHao&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.haohaoreport.com/submit.php?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Identi.ca&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://identi.ca/notice/new?status_textarea=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;IndianPad&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.indianpad.com/submit.php?url=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Linked In&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.linkedin.com/shareArticle?mini=true&amp;amp;url=[URL]&amp;amp;title=[TEXT TITLE]&amp;amp;summary=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Live Favorites&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Mister Wong&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.mister-wong.com/addurl/?bm_url=[URL]&amp;amp;bm_description=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Mixx&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.mixx.com/submit?page_url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;MySpace&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.myspace.com/Modules/PostTo/Pages/?u=[URL]&amp;amp;t=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Netvibes&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.netvibes.com/share?title=[TEXT TITLE]&amp;amp;url=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Newsvine&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.newsvine.com/_tools/seed&amp;amp;save?u=[URL]&amp;amp;h=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Ping.fm&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://ping.fm/ref/?link=[URL]&amp;amp;title=[TEXT TITLE]&amp;amp;body=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Posterous&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://posterous.com/share?linkto=[URL]&amp;amp;title=[TEXT TITLE]&amp;amp;selection=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Propeller&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.propeller.com/submit/?url=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Reddit&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://reddit.com/submit?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Scoopeo&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.scoopeo.com/scoop/new?newurl=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Simpy&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://simpy.com/simpy/LinkAdd.do? title=[TEXT TITLE]&amp;amp;href=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Slashdot&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://slashdot.org/bookmark.pl?title=[TEXT TITLE]&amp;amp;url=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;SocialNews&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.socialnews.biz/submit?url=[URL]&amp;amp;title=[TEXT TITLE] ?&amp;gt;&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Sphere&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.sphere.com/search?q=sphereit:[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Sphinn&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://sphinn.com/index.php?c=post&amp;amp;m=submit&amp;amp;link=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Spurl&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.spurl.net/spurl.php? url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Squidoo&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.squidoo.com/lensmaster/bookmark?[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;StumbleUpon&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.stumbleupon.com/submit?url=[URL]&amp;amp;title=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Technorati&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://technorati.com/faves?add=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Tipd&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://tipd.com/submit.php?url=[URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Tumblr&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.tumblr.com/share?v=3&amp;amp;u=[URL]&amp;amp;t=[TEXT TITLE]&amp;amp;s=[EXCERPT]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Twitter&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://twitter.com/home?status=[TEXT TITLE] - [URL]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Wink&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://www.wink.com/_/tag? url=[URL]&amp;amp;doctitle=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Yahoo Bookmarks&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://bookmarks.yahoo.com/toolbar/savebm?u=[URL]&amp;amp;t=[TEXT TITLE]&lt;/div&gt;&lt;b style=&quot;font-size: large;&quot;&gt;Yahoo Buzz&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;color: blue; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;http://buzz.yahoo.com/buzz?targetUrl=[URL]&amp;amp;headline=[TEXT TITLE]&amp;amp;summary==[EXCERPT]&lt;/div&gt;&lt;h4&gt;Are You Know About Social Bookmarking?&lt;/h4&gt;Social bookmarking is a method for Internet users to organize, store, manage and search for bookmarks of resources online. Unlike file sharing, the resources themselves aren&#39;t shared, merely bookmarks that reference them.&lt;br /&gt;
&lt;br /&gt;
Descriptions may be added to these bookmarks in the form of metadata, so users may understand the content of the resource without first needing to download it for themselves. Such descriptions may be free text comments, votes in favour of or against its quality, or tags that collectively or collaboratively become a folksonomy. Folksonomy is also called social tagging, &quot;the process by which many users add metadata in the form of keywords to shared content&quot;.&lt;br /&gt;
&lt;br /&gt;
In a social bookmarking system, users save links to web pages that they want to remember and/or share. These bookmarks are usually public, and can be saved privately, shared only with specified people or groups, shared only inside certain networks, or another combination of public and private domains. The allowed people can usually view these bookmarks chronologically, by category or tags, or via a search engine.&lt;br /&gt;
&lt;br /&gt;
Most social bookmark services encourage users to organize their bookmarks with informal tags instead of the traditional browser-based system of folders, although some services feature categories/folders or a combination of folders and tags. They also enable viewing bookmarks associated with a chosen tag, and include information about the number of users who have bookmarked them. Some social bookmarking services also draw inferences from the relationship of tags to create clusters of tags or bookmarks.&lt;br /&gt;
&lt;br /&gt;
Many social bookmarking services provide web feeds for their lists of bookmarks, including lists organized by tags. This allows subscribers to become aware of new bookmarks as they are saved, shared, and tagged by other users.&lt;br /&gt;
&lt;br /&gt;
As these services have matured and grown more popular, they have added extra features such as ratings and comments on bookmarks, the ability to import and export bookmarks from browsers, emailing of bookmarks, web annotation, and groups or other social network features[&lt;a href=&quot;http://en.wikipedia.org/wiki/Social_bookmarking&quot;&gt;wikipedia.org&lt;/a&gt;]&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/1201982508636672838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/08/share-url-html-code-for-blogger-social.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1201982508636672838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1201982508636672838'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/08/share-url-html-code-for-blogger-social.html' title='Share Url HTML Code for Blogger (Social Bookmarking)'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-2264563421751522168</id><published>2011-08-02T02:14:00.000-07:00</published><updated>2011-08-02T02:14:17.157-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Form"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Custom Form Appearance With Standard Behaviour</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZU-a2NuRivoQIuYLmR8XvlUnZZr5M4m0AlUSjDeuCudcnuKr0eO24Qqvp_O4ooqI-7jdK2tBqdWkRLexetZwyHnP6XD_qEJYgi3K8A_43FSf3oHPR59BqqjWR1M3Isg4t2CINHUVnN1U/s1600/Custom+Form+Appearance+With+Standard+Behaviour.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;340&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZU-a2NuRivoQIuYLmR8XvlUnZZr5M4m0AlUSjDeuCudcnuKr0eO24Qqvp_O4ooqI-7jdK2tBqdWkRLexetZwyHnP6XD_qEJYgi3K8A_43FSf3oHPR59BqqjWR1M3Isg4t2CINHUVnN1U/s400/Custom+Form+Appearance+With+Standard+Behaviour.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;There are several ways to Custom Paint a form, but each has their flaw.&lt;br /&gt;
This method starts with a standard Form that has its BorderStyle set to None.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
We also create a WindowMenu class which pops up in place of the standard WindowMenu. We do this because restoring the standard WindowMenu causes the standard Window Size options to be lost and these cannot be restored without adding the sizable border which we do not want to see.&lt;br /&gt;
&lt;br /&gt;
To get the standard Size and Move options we simply create GraphicsPaths that react to the mouse in the same way as the standard Non-Client form parts do. To achieve this we simply intercept and manipulate a few standard Windows messages. For this article I have not used any Interop calls, but you may get more flexible results by using SendMessage() and SetMenuItemBitmaps() rather than sending WndProc() calls and OwnerDrawing the custom WindowMenu.&lt;br /&gt;
&lt;br /&gt;
The example here simply paints the defined paths in order that you can physically see how this method works, it is not meant to be pretty. You are not restricted to where the paths are placed or what shape they are, you dont even have to stick to them exactly when painting, the paths are simply there for mouse interaction.&lt;br /&gt;
The only real problem with this method is that if you set AutoScroll to true then Scrollbars will appear on top of the fake NonClientArea. A simple fix for this is to dock a Panel to the form (set the forms margins as appropiate) and use this as the Form Client. &lt;br /&gt;
&lt;br /&gt;
You&#39;ll need to add images to your projects resources for the buttons. You can download the images that I used &lt;a href=&quot;http://dotnetrix.co.uk/download/Resources.zip&quot;&gt;here...&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Imports System.Drawing.Drawing2D
Imports System.Security.Permissions
Public Class Form1
  Inherits System.Windows.Forms.Form
  &#39;Form overrides dispose to clean up the component list.
  &amp;lt;System.Diagnostics.DebuggerNonUserCode()&amp;gt; _
  Protected Overrides Sub Dispose(ByVal disposing As Boolean)
    Try
    If disposing AndAlso components IsNot Nothing Then
      components.Dispose()
    End If
    Finally
    MyBase.Dispose(disposing)
    End Try
  End Sub
  &#39;Required by the Windows Form Designer
  Private components As System.ComponentModel.IContainer
  &#39;NOTE: The following procedure is required by the Windows Form Designer
  &#39;It can be modified using the Windows Form Designer.  
  &#39;Do not modify it using the code editor.
  &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; _
  Private Sub InitializeComponent()
    Me.Panel1 = New System.Windows.Forms.Panel
    Me.SuspendLayout()
    &#39;
    &#39;Panel1
    &#39;
    Me.Panel1.AutoScroll = True
    Me.Panel1.AutoScrollMinSize = New System.Drawing.Size(340, 300)
    Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
    Me.Panel1.Location = New System.Drawing.Point(7, 6)
    Me.Panel1.Margin = New System.Windows.Forms.Padding(4)
    Me.Panel1.Name = &quot;Panel1&quot;
    Me.Panel1.Size = New System.Drawing.Size(375, 319)
    Me.Panel1.TabIndex = 0
    &#39;
    &#39;Form1
    &#39;
    Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
    Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
    Me.BackColor = System.Drawing.Color.LemonChiffon
    Me.ClientSize = New System.Drawing.Size(389, 331)
    Me.Controls.Add(Me.Panel1)
    Me.DoubleBuffered = True
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
    Me.MinimumSize = New System.Drawing.Size(133, 62)
    Me.Name = &quot;Form1&quot;
    Me.Padding = New System.Windows.Forms.Padding(7, 6, 7, 6)
    Me.Text = &quot;CustomForm&quot;
    Me.ResumeLayout(False)
  End Sub
  Friend WithEvents Panel1 As System.Windows.Forms.Panel
  Private leftEdge, topEdge, bottomEdge, rightEdge, _
  topLeftEdge, topRightEdge, bottomLeftEdge, bottomRightEdge, _
  titleBar, closeButton, maxButton, minButton, iconButton As GraphicsPath
  Private formActive As Boolean = True
  Private ButtonTip As ToolTip
  Private SystemMenu As WindowMenu
  Public Sub New()
    &#39; This call is required by the Windows Form Designer.
    InitializeComponent()
    &#39; Add any initialization after the InitializeComponent() call.
    Me.leftEdge = New GraphicsPath()
    Me.topEdge = New GraphicsPath()
    Me.rightEdge = New GraphicsPath()
    Me.bottomEdge = New GraphicsPath()
    Me.topLeftEdge = New GraphicsPath()
    Me.topRightEdge = New GraphicsPath()
    Me.bottomLeftEdge = New GraphicsPath()
    Me.bottomRightEdge = New GraphicsPath()
    Me.titleBar = New GraphicsPath()
    Me.closeButton = New GraphicsPath()
    Me.maxButton = New GraphicsPath()
    Me.minButton = New GraphicsPath()
    Me.iconButton = New GraphicsPath()
    BuildPaths()
    Me.MaximizedBounds = Screen.GetWorkingArea(Me)
    Me.Padding = New Padding(5, titleBar.GetBounds().Height + 7, 5, 5)
    Me.SystemMenu = New WindowMenu(Me)
    AddHandler Me.SystemMenu.SystemEvent, AddressOf SystemMenu_SystemEvent
    ButtonTip = New ToolTip()
  End Sub
  Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
    Get
    Const WS_MINIMIZEBOX As Int32 = &amp;amp;H20000
    Dim cParams As System.Windows.Forms.CreateParams = MyBase.CreateParams
    cParams.Style = cParams.Style Or WS_MINIMIZEBOX
    Return cParams
    End Get
  End Property
  Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
    If (Me.Created) Then
    BuildPaths()
    Me.Invalidate()
    Me.ButtonTip.SetToolTip(Me, &quot;&quot;)
    End If
  End Sub
  Private Sub Form1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
    e.Graphics.FillPath(Brushes.Orange, leftEdge)
    e.Graphics.FillPath(Brushes.Orange, topEdge)
    e.Graphics.FillPath(Brushes.Orange, rightEdge)
    e.Graphics.FillPath(Brushes.Orange, bottomEdge)
    e.Graphics.FillPath(Brushes.Coral, topLeftEdge)
    e.Graphics.FillPath(Brushes.Coral, topRightEdge)
    e.Graphics.FillPath(Brushes.Coral, bottomLeftEdge)
    e.Graphics.FillPath(Brushes.Coral, bottomRightEdge)
    If (Not Me.formActive) Then
    e.Graphics.FillRectangle(Brushes.Silver, Rectangle.Round(titleBar.GetBounds()))
    End If
    Dim rc As Rectangle = Rectangle.Round(iconButton.GetBounds())
    Using bm As Bitmap = IIf(Me.TopMost, My.Resources.Pin, My.Resources.UnPin)
    bm.MakeTransparent(Color.Magenta)
    e.Graphics.DrawImage(bm, rc)
    End Using
    rc = Rectangle.Round(minButton.GetBounds())
    Using bm As Bitmap = My.Resources.Min
    bm.MakeTransparent(Color.Magenta)
    e.Graphics.DrawImage(bm, rc)
    End Using
    rc = Rectangle.Round(maxButton.GetBounds())
    Using bm As Bitmap = IIf(Me.WindowState = FormWindowState.Normal, My.Resources.Max, My.Resources.Restore)
    bm.MakeTransparent(Color.Magenta)
    e.Graphics.DrawImage(bm, rc)
    End Using
    rc = Rectangle.Round(closeButton.GetBounds())
    Using bm As Bitmap = My.Resources.Close
    bm.MakeTransparent(Color.Magenta)
    e.Graphics.DrawImage(bm, rc)
    End Using
    Using myPen As Pen = New Pen(Color.Orange, 2)
    rc = Me.DisplayRectangle
    e.Graphics.DrawLine(myPen, rc.Left, rc.Top - 2, rc.Right, rc.Top - 2)
    End Using
    Dim textRect As RectangleF = titleBar.GetBounds()
    textRect.X += iconButton.GetBounds().Width + 3
    textRect.Width = minButton.GetBounds().Left - textRect.Left
    TextRenderer.DrawText(e.Graphics, Me.Text, SystemFonts.CaptionFont, Rectangle.Round(textRect), Color.DarkGoldenrod, TextFormatFlags.EndEllipsis Or TextFormatFlags.VerticalCenter)
  End Sub
  Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
    MyBase.OnTextChanged(e)
    Me.Invalidate()
  End Sub
  Private Sub BuildPaths()
    Dim edgeSize As Int32 = SystemInformation.CaptionHeight + 2
    Dim buttonSize As Int32 = SystemFonts.CaptionFont.Height
    Dim buttonPadding As Int32 = 2
    &#39;Left Sizing Edge
    leftEdge.Reset()
    leftEdge.AddRectangle(New Rectangle(0, edgeSize, 5, Me.Height - (edgeSize * 2)))
    &#39;Top Sizing Edge
    topEdge.Reset()
    topEdge.AddRectangle(New Rectangle(edgeSize, 0, Me.Width - (edgeSize * 2), 5))
    &#39;Right Sizing Edge
    rightEdge.Reset()
    rightEdge.AddRectangle(New Rectangle(Me.Width - 5, edgeSize, 5, Me.Height - (edgeSize * 2)))
    &#39;Bottom Sizing Edge
    bottomEdge.Reset()
    bottomEdge.AddRectangle(New Rectangle(edgeSize, Me.Height - 5, Me.Width - (edgeSize * 2), 5))
    &#39;Top-Left Sizing Edge
    topLeftEdge.Reset()
    topLeftEdge.AddRectangle(New Rectangle(0, 0, edgeSize, edgeSize))
    topLeftEdge.AddRectangle(New Rectangle(5, 5, edgeSize - 5, edgeSize - 5))
    &#39;Top-Right Sizing Edge
    topRightEdge.Reset()
    topRightEdge.AddRectangle(New Rectangle(Me.Width - edgeSize, 0, edgeSize, edgeSize))
    topRightEdge.AddRectangle(New Rectangle(Me.Width - edgeSize, 5, edgeSize - 5, edgeSize - 5))
    &#39;Bottom-Left Sizing Edge
    bottomLeftEdge.Reset()
    bottomLeftEdge.AddRectangle(New Rectangle(0, Me.Height - edgeSize, edgeSize, edgeSize))
    bottomLeftEdge.AddRectangle(New Rectangle(5, Me.Height - edgeSize, edgeSize - 5, edgeSize - 5))
    &#39;Bottom-Right Sizing Edge
    bottomRightEdge.Reset()
    bottomRightEdge.AddRectangle(New Rectangle(Me.Width - edgeSize, Me.Height - edgeSize, edgeSize, edgeSize))
    bottomRightEdge.AddRectangle(New Rectangle(Me.Width - edgeSize, Me.Height - edgeSize, edgeSize - 5, edgeSize - 5))
    &#39;Close Button
    closeButton.Reset()
    closeButton.AddRectangle(New Rectangle(Me.Width - 5 - (buttonSize + buttonPadding), 8, buttonSize, buttonSize))
    &#39;Maximize Button
    maxButton.Reset()
    maxButton.AddRectangle(New Rectangle(Me.Width - 5 - ((buttonSize + buttonPadding) * 2), 8, buttonSize, buttonSize))
    &#39;Minimize Button
    minButton.Reset()
    minButton.AddRectangle(New Rectangle(Me.Width - 5 - ((buttonSize + buttonPadding) * 3), 8, buttonSize, buttonSize))
    &#39;Window Menu Button (Icon)
    iconButton.Reset()
    iconButton.AddRectangle(New Rectangle(8, 8, buttonSize, buttonSize))
    &#39;TitleBar
    titleBar.Reset()
    titleBar.AddRectangle(New Rectangle(5, 5, Me.Width - 10, edgeSize - 5))
    &#39;Remove Titlebar Buttons from TitleBar Path
    titleBar.AddPath(closeButton, False)
    titleBar.AddPath(maxButton, False)
    titleBar.AddPath(minButton, False)
    titleBar.AddPath(iconButton, False)
  End Sub
  &amp;lt;PermissionSet(SecurityAction.Demand, Name:=&quot;FullTrust&quot;)&amp;gt; _
  Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
    If (Me.WindowState = FormWindowState.Maximized) Then
    If (m.Msg = User32.WM_SYSCOMMAND AndAlso _
        m.WParam.ToInt32() = User32.SysCommand.SC_MOVE OrElse _
        m.Msg = User32.NCMouseMessage.WM_NCLBUTTONDOWN AndAlso _
        m.WParam.ToInt32() = User32.NCHitTestResult.HTCAPTION) Then
      m.Msg = User32.WM_NULL
    End If
    End If
    MyBase.WndProc(m)
    Select Case (m.Msg)
    Case User32.WM_GETSYSMENU
      Me.SystemMenu.Show(Me, Me.PointToClient(New Point(m.LParam.ToInt32())))
    Case User32.WM_NCACTIVATE
      Me.formActive = m.WParam.ToInt32() &amp;lt;&amp;gt; 0
      Me.Invalidate()
    Case User32.WM_NCHITTEST
      m.Result = OnNonClientHitTest(m.LParam)
    Case User32.NCMouseMessage.WM_NCLBUTTONUP
      OnNonClientLButtonUp(m.LParam)
    Case User32.NCMouseMessage.WM_NCRBUTTONUP
      OnNonClientRButtonUp(m.LParam)
    Case User32.NCMouseMessage.WM_NCMOUSEMOVE
      OnNonClientMouseMove(m.LParam)
    End Select
  End Sub
  Private Sub OnNonClientLButtonUp(ByVal lParam As IntPtr)
    Dim code As User32.SysCommand = User32.SysCommand.SC_DEFAULT
    Dim point As Point = Me.PointToClient(New Point(lParam.ToInt32()))
    If (Me.iconButton.IsVisible(point)) Then
    Me.TopMost = Not Me.TopMost
    Me.Invalidate()
    Else
    If (Me.closeButton.IsVisible(point)) Then
      code = User32.SysCommand.SC_CLOSE
    ElseIf (Me.maxButton.IsVisible(point)) Then
      code = IIf(Me.WindowState = FormWindowState.Normal, User32.SysCommand.SC_MAXIMIZE, User32.SysCommand.SC_RESTORE)
    ElseIf (Me.minButton.IsVisible(point)) Then
      code = User32.SysCommand.SC_MINIMIZE
    End If
    SendNCWinMessage(User32.WM_SYSCOMMAND, New IntPtr(code), IntPtr.Zero)
    End If
  End Sub
  Private Sub OnNonClientRButtonUp(ByVal lParam As IntPtr)
    If (Me.titleBar.IsVisible(Me.PointToClient(New Point(lParam.ToInt32())))) Then
    SendNCWinMessage(User32.WM_GETSYSMENU, IntPtr.Zero, lParam)
    End If
  End Sub
  Private Sub OnNonClientMouseMove(ByVal lParam As IntPtr)
    Dim point As Point = Me.PointToClient(New Point(lParam.ToInt32()))
    Dim tooltip As String
    If (Me.closeButton.IsVisible(point)) Then
    tooltip = &quot;Close&quot;
    ElseIf (Me.maxButton.IsVisible(point)) Then
    tooltip = IIf(Me.WindowState = FormWindowState.Normal, &quot;Maximize&quot;, &quot;Restore&quot;)
    ElseIf (Me.minButton.IsVisible(point)) Then
    tooltip = &quot;Minimize&quot;
    ElseIf (Me.iconButton.IsVisible(point)) Then
    tooltip = IIf(Me.TopMost, &quot;Un-Pin&quot;, &quot;Pin&quot;)
    Else
    tooltip = String.Empty
    End If
    If (ButtonTip.GetToolTip(Me) &amp;lt;&amp;gt; tooltip) Then
    ButtonTip.SetToolTip(Me, tooltip)
    End If
  End Sub
  Private Function OnNonClientHitTest(ByVal lParam As IntPtr) As IntPtr
    Dim result As User32.NCHitTestResult = User32.NCHitTestResult.HTCLIENT
    Dim point As Point = Me.PointToClient(New Point(lParam.ToInt32()))
    If (Me.titleBar.IsVisible(point)) Then
    result = User32.NCHitTestResult.HTCAPTION
    End If
    If (Me.WindowState = FormWindowState.Normal) Then
    If (Me.topLeftEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTTOPLEFT
    ElseIf (Me.topEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTTOP
    ElseIf (Me.topRightEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTTOPRIGHT
    ElseIf (Me.leftEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTLEFT
    ElseIf (Me.rightEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTRIGHT
    ElseIf (Me.bottomLeftEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTBOTTOMLEFT
    ElseIf (Me.bottomEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTBOTTOM
    ElseIf (Me.bottomRightEdge.IsVisible(point)) Then
      result = User32.NCHitTestResult.HTBOTTOMRIGHT
    End If
    End If
    If (Me.closeButton.IsVisible(point)) Then
    result = User32.NCHitTestResult.HTBORDER
    ElseIf (Me.maxButton.IsVisible(point)) Then
    result = User32.NCHitTestResult.HTBORDER
    ElseIf (Me.minButton.IsVisible(point)) Then
    result = User32.NCHitTestResult.HTBORDER
    ElseIf (Me.iconButton.IsVisible(point)) Then
    result = User32.NCHitTestResult.HTBORDER
    End If
    Return New IntPtr(result)
  End Function
  Private Sub SendNCWinMessage(ByVal msg As Int32, ByVal wParam As IntPtr, ByVal lParam As IntPtr)
    Dim message As Message = message.Create(Me.Handle, msg, wParam, lParam)
    Me.WndProc(message)
  End Sub
  Protected Sub SystemMenu_SystemEvent(ByVal sender As Object, ByVal ev As WindowMenuEventArgs)
    SendNCWinMessage(User32.WM_SYSCOMMAND, New IntPtr(ev.SystemCommand), IntPtr.Zero)
  End Sub
End Class
Friend NotInheritable Class User32
  Private Sub New()
    MyBase.New()
    &#39;Non-Instantiable class
  End Sub
  Public Enum SysCommand
    SC_SIZE = &amp;amp;HF000
    SC_MOVE = &amp;amp;HF010
    SC_MINIMIZE = &amp;amp;HF020
    SC_MAXIMIZE = &amp;amp;HF030
    SC_NEXTWINDOW = &amp;amp;HF040
    SC_PREVWINDOW = &amp;amp;HF050
    SC_CLOSE = &amp;amp;HF060
    SC_VSCROLL = &amp;amp;HF070
    SC_HSCROLL = &amp;amp;HF080
    SC_MOUSEMENU = &amp;amp;HF090
    SC_KEYMENU = &amp;amp;HF100
    SC_ARRANGE = &amp;amp;HF110
    SC_RESTORE = &amp;amp;HF120
    SC_TASKLIST = &amp;amp;HF130
    SC_SCREENSAVE = &amp;amp;HF140
    SC_HOTKEY = &amp;amp;HF150
    SC_DEFAULT = &amp;amp;HF160
    SC_MONITORPOWER = &amp;amp;HF170
    SC_CONTEXTHELP = &amp;amp;HF180
    SC_SEPARATOR = &amp;amp;HF00F
  End Enum
  Public Enum NCHitTestResult
    HTERROR = (-2)
    HTTRANSPARENT
    HTNOWHERE
    HTCLIENT
    HTCAPTION
    HTSYSMENU
    HTGROWBOX
    HTMENU
    HTHSCROLL
    HTVSCROLL
    HTMINBUTTON
    HTMAXBUTTON
    HTLEFT
    HTRIGHT
    HTTOP
    HTTOPLEFT
    HTTOPRIGHT
    HTBOTTOM
    HTBOTTOMLEFT
    HTBOTTOMRIGHT
    HTBORDER
    HTOBJECT
    HTCLOSE
    HTHELP
  End Enum
  Public Enum NCMouseMessage
    WM_NCMOUSEMOVE = &amp;amp;HA0
    WM_NCLBUTTONDOWN = &amp;amp;HA1
    WM_NCLBUTTONUP = &amp;amp;HA2
    WM_NCLBUTTONDBLCLK = &amp;amp;HA3
    WM_NCRBUTTONDOWN = &amp;amp;HA4
    WM_NCRBUTTONUP = &amp;amp;HA5
    WM_NCRBUTTONDBLCLK = &amp;amp;HA6
    WM_NCMBUTTONDOWN = &amp;amp;HA7
    WM_NCMBUTTONUP = &amp;amp;HA8
    WM_NCMBUTTONDBLCLK = &amp;amp;HA9
    WM_NCXBUTTONDOWN = &amp;amp;HAB
    WM_NCXBUTTONUP = &amp;amp;HAC
    WM_NCXBUTTONDBLCLK = &amp;amp;HAD
  End Enum
  Public Const WM_NULL As Int32 = &amp;amp;H0
  Public Const WM_NCHITTEST As Int32 = &amp;amp;H84
  Public Const WM_NCACTIVATE As Int32 = &amp;amp;H86
  Public Const WM_SYSCOMMAND As Int32 = &amp;amp;H112
  Public Const WM_ENTERMENULOOP As Int32 = &amp;amp;H211
  Public Const WM_EXITMENULOOP As Int32 = &amp;amp;H212
  &#39;********** Undocumented message **********
  Public Const WM_GETSYSMENU As Int32 = &amp;amp;H313
  &#39;*****************************************
  Public Shared Function MakeLParam(ByVal LoWord As Int32, ByVal HiWord As Int32) As IntPtr
    Return New IntPtr((HiWord &amp;lt;&amp;lt; 16) Or (LoWord And &amp;amp;HFFFF))
  End Function
End Class
Friend NotInheritable Class WindowMenu
  Inherits ContextMenu
  Private Owner As Form
  Private menuRestore, menuMove, menuSize, menuMin, menuMax, menuSep, menuClose As MenuItem
  Public Event SystemEvent As WindowMenuEventHandler
  Public Sub New(ByVal owner As Form)
    MyBase.New()
    Me.Owner = owner
    menuRestore = CreateMenuItem(&quot;Restore&quot;)
    menuMove = CreateMenuItem(&quot;Move&quot;)
    menuSize = CreateMenuItem(&quot;Size&quot;)
    menuMin = CreateMenuItem(&quot;Minimize&quot;)
    menuMax = CreateMenuItem(&quot;Maximize&quot;)
    menuSep = CreateMenuItem(&quot;-&quot;)
    menuClose = CreateMenuItem(&quot;Close&quot;, Shortcut.AltF4)
    Me.MenuItems.AddRange(New MenuItem() {menuRestore, menuMove, menuSize, menuMin, menuMax, menuSep, menuClose})
    menuClose.DefaultItem = True
  End Sub
  Protected Overrides Sub OnPopup(ByVal e As EventArgs)
    Select Case Owner.WindowState
    Case FormWindowState.Normal
      menuRestore.Enabled = False
      menuMax.Enabled = True
      menuMin.Enabled = True
      menuMove.Enabled = True
      menuSize.Enabled = True
    Case FormWindowState.Minimized
      menuRestore.Enabled = True
      menuMax.Enabled = True
      menuMin.Enabled = False
      menuMove.Enabled = False
      menuSize.Enabled = False
    Case FormWindowState.Maximized
      menuRestore.Enabled = True
      menuMax.Enabled = False
      menuMin.Enabled = True
      menuMove.Enabled = False
      menuSize.Enabled = False
    End Select
    MyBase.OnPopup(e)
  End Sub
  Private Sub OnWindowMenuClick(ByVal sender As Object, ByVal e As EventArgs)
    Select Case Me.MenuItems.IndexOf(DirectCast(sender, MenuItem))
    Case 0
      SendSysCommand(User32.SysCommand.SC_RESTORE)
    Case 1
      SendSysCommand(User32.SysCommand.SC_MOVE)
    Case 2
      SendSysCommand(User32.SysCommand.SC_SIZE)
    Case 3
      SendSysCommand(User32.SysCommand.SC_MINIMIZE)
    Case 4
      SendSysCommand(User32.SysCommand.SC_MAXIMIZE)
    Case 6
      SendSysCommand(User32.SysCommand.SC_CLOSE)
    End Select
  End Sub
  Private Function CreateMenuItem(ByVal text As String) As MenuItem
    Return CreateMenuItem(text, Shortcut.None)
  End Function
  Private Function CreateMenuItem(ByVal text As String, ByVal shortcut As Shortcut) As MenuItem
    Dim item As MenuItem = New MenuItem(text, AddressOf OnWindowMenuClick, shortcut)
    item.OwnerDraw = True
    AddHandler item.MeasureItem, AddressOf item_MeasureItem
    AddHandler item.DrawItem, AddressOf item_DrawItem
    Return item
  End Function
  Private Sub item_MeasureItem(ByVal sender As Object, ByVal e As MeasureItemEventArgs)
    Dim item As MenuItem = Me.MenuItems(e.Index)
    Dim itemText As String = item.Text
    itemText += &quot;/tAlt+F4&quot;
    Dim itemSize As Size = TextRenderer.MeasureText(itemText, SystemFonts.MenuFont)
    e.ItemHeight = IIf(e.Index = 5, 8, itemSize.Height + 7)
    e.ItemWidth = itemSize.Width + itemSize.Height + 23
  End Sub
  Private Sub item_DrawItem(ByVal sender As Object, ByVal e As DrawItemEventArgs)
    Dim item As MenuItem = Me.MenuItems(e.Index)
    If item.Enabled Then
    e.DrawBackground()
    Else
    e.Graphics.FillRectangle(SystemBrushes.Menu, e.Bounds)
    End If
    If e.Index = 5 Then
    e.Graphics.DrawLine(SystemPens.GrayText, e.Bounds.Left + 2, e.Bounds.Top + 3, e.Bounds.Right - 2, e.Bounds.Top + 3)
    Else
    Dim format As TextFormatFlags = TextFormatFlags.HorizontalCenter Or TextFormatFlags.VerticalCenter Or TextFormatFlags.NoPadding
    Dim textColor As Color = IIf(item.Enabled, SystemColors.MenuText, SystemColors.GrayText)
    Using marlettFont As New Font(&quot;Marlett&quot;, 10)
      Dim GlyphRect As Rectangle = e.Bounds
      GlyphRect.Width = GlyphRect.Height
      If item Is menuRestore Then
        TextRenderer.DrawText(e.Graphics, &quot;2&quot;, marlettFont, GlyphRect, textColor, format)
      ElseIf item Is menuMin Then
        TextRenderer.DrawText(e.Graphics, &quot;0&quot;, marlettFont, GlyphRect, textColor, format)
      ElseIf item Is menuMax Then
        TextRenderer.DrawText(e.Graphics, &quot;1&quot;, marlettFont, GlyphRect, textColor, format)
      ElseIf item Is menuClose Then
        TextRenderer.DrawText(e.Graphics, &quot;r&quot;, marlettFont, GlyphRect, textColor, format)
      End If
    End Using
    format = format And (TextFormatFlags.Left Or Not TextFormatFlags.HorizontalCenter)
    Dim textRect As Rectangle = New Rectangle(e.Bounds.Left + e.Bounds.Height + 3, e.Bounds.Top, e.Bounds.Width - e.Bounds.Height - 3, e.Bounds.Height)
    TextRenderer.DrawText(e.Graphics, item.Text, SystemFonts.MenuFont, textRect, textColor, format)
    If (item Is menuClose) Then
      Dim shortcut As String = &quot;Alt+F4&quot;
      Dim shortcutSize As Size = TextRenderer.MeasureText(shortcut, SystemFonts.MenuFont)
      textRect.X = textRect.Right - shortcutSize.Width - 13
      TextRenderer.DrawText(e.Graphics, shortcut, SystemFonts.MenuFont, textRect, textColor, format)
    End If
    End If
  End Sub
  Private Sub SendSysCommand(ByVal command As User32.SysCommand)
    Dim ev As WindowMenuEventArgs = New WindowMenuEventArgs(DirectCast(command, Int32))
    RaiseEvent SystemEvent(Me, ev)
  End Sub
End Class
Public Class WindowMenuEventArgs
  Inherits EventArgs
  Private sysCommand As Int32
  Public ReadOnly Property SystemCommand() As Int32
    Get
    Return Me.sysCommand
    End Get
  End Property
  Public Sub New(ByVal command As Int32)
    MyBase.new()
    Me.sysCommand = command
  End Sub
End Class
Public Delegate Sub WindowMenuEventHandler(ByVal sender As Object, ByVal ev As WindowMenuEventArgs)
        &lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System;
using System.Drawing;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using CustomForm.Properties;
using System.Security.Permissions;
namespace CustomForm
{
  public class Form1 : Form
  {
    /// &amp;lt;summary&amp;gt;
    /// Required designer variable.
    /// &amp;lt;/summary&amp;gt;
    private System.ComponentModel.IContainer components = null;
    /// &amp;lt;summary&amp;gt;
    /// Clean up any resources being used.
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name=&quot;disposing&quot;&amp;gt;true if managed resources should be disposed; otherwise, false.&amp;lt;/param&amp;gt;
    protected override void Dispose(bool disposing)
    {
    if (disposing &amp;amp;&amp;amp; (components != null))
    {
      components.Dispose();
    }
    base.Dispose(disposing);
    }
    #region Windows Form Designer generated code
    /// &amp;lt;summary&amp;gt;
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// &amp;lt;/summary&amp;gt;
    private void InitializeComponent()
    {
    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
    this.panel1 = new System.Windows.Forms.Panel();
    this.SuspendLayout();
    // 
    // panel1
    // 
    this.panel1.AutoScroll = true;
    this.panel1.AutoScrollMinSize = new System.Drawing.Size(340, 300);
    this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
    this.panel1.Location = new System.Drawing.Point(7, 6);
    this.panel1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    this.panel1.Name = &quot;panel1&quot;;
    this.panel1.Size = new System.Drawing.Size(375, 319);
    this.panel1.TabIndex = 0;
    // 
    // Form1
    // 
    this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
    this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    this.BackColor = System.Drawing.Color.LemonChiffon;
    this.ClientSize = new System.Drawing.Size(389, 331);
    this.Controls.Add(this.panel1);
    this.DoubleBuffered = true;
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.Icon = ((System.Drawing.Icon)(resources.GetObject(&quot;$this.Icon&quot;)));
    this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
    this.MinimumSize = new System.Drawing.Size(133, 62);
    this.Name = &quot;Form1&quot;;
    this.Padding = new System.Windows.Forms.Padding(7, 6, 7, 6);
    this.Text = &quot;CustomForm&quot;;
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
    this.Resize += new System.EventHandler(this.Form1_Resize);
    this.ResumeLayout(false);
    }
    #endregion
    private System.Windows.Forms.Panel panel1;
    private GraphicsPath leftEdge, topEdge ,bottomEdge, rightEdge,
    topLeftEdge, topRightEdge, bottomLeftEdge, bottomRightEdge, 
    titleBar, closeButton, maxButton, minButton, iconButton;
    private bool formActive = true;
    private ToolTip ButtonTip;
    private WindowMenu SystemMenu;
    
    public Form1()
    {
    InitializeComponent();
    this.leftEdge = new GraphicsPath();
    this.topEdge = new GraphicsPath();
    this.rightEdge = new GraphicsPath();
    this.bottomEdge = new GraphicsPath();
    this.topLeftEdge = new GraphicsPath();
    this.topRightEdge = new GraphicsPath();
    this.bottomLeftEdge = new GraphicsPath();
    this.bottomRightEdge = new GraphicsPath();
    this.titleBar = new GraphicsPath();
    this.closeButton = new GraphicsPath();
    this.maxButton = new GraphicsPath();
    this.minButton = new GraphicsPath();
    this.iconButton = new GraphicsPath();
    BuildPaths();
    this.MaximizedBounds = Screen.GetWorkingArea(this);
    this.Padding = new Padding(5,(int)titleBar.GetBounds().Height+7, 5, 5);
    this.SystemMenu = new WindowMenu(this);
    this.SystemMenu.SystemEvent += new WindowMenuEventHandler(SystemMenu_SystemEvent);
    ButtonTip = new ToolTip();
    }
    protected override CreateParams CreateParams
    {
    get
    {
      const int WS_MINIMIZEBOX = 0x20000;
      System.Windows.Forms.CreateParams cParams = base.CreateParams;
      cParams.Style |= WS_MINIMIZEBOX;
      return cParams;
    }
    }
    private void Form1_Resize(object sender, EventArgs e)
    {
    if (this.Created)
    {
      BuildPaths();
      this.Invalidate();
      this.ButtonTip.SetToolTip(this, &quot;&quot;);
    }
    }
    private void Form1_Paint(object sender, PaintEventArgs e)
    {
    e.Graphics.FillPath(Brushes.Orange, leftEdge);
    e.Graphics.FillPath(Brushes.Orange, topEdge);
    e.Graphics.FillPath(Brushes.Orange, rightEdge);
    e.Graphics.FillPath(Brushes.Orange, bottomEdge);
    e.Graphics.FillPath(Brushes.Coral, topLeftEdge);
    e.Graphics.FillPath(Brushes.Coral, topRightEdge);
    e.Graphics.FillPath(Brushes.Coral, bottomLeftEdge);
    e.Graphics.FillPath(Brushes.Coral, bottomRightEdge);
    if (!this.formActive)
    {
      e.Graphics.FillRectangle(Brushes.Silver, Rectangle.Round(titleBar.GetBounds()));
    }
    Rectangle rc = Rectangle.Round(iconButton.GetBounds());
    using (Bitmap bm = this.TopMost ? Resources.Pin : Resources.UnPin)
    {
      bm.MakeTransparent(Color.Magenta);
      e.Graphics.DrawImage(bm, rc);
    }
    rc = Rectangle.Round(minButton.GetBounds());
    using (Bitmap bm = Resources.Min)
    {
      bm.MakeTransparent(Color.Magenta);
      e.Graphics.DrawImage(bm, rc);
    }
    rc = Rectangle.Round(maxButton.GetBounds());
    using (Bitmap bm = this.WindowState == FormWindowState.Normal ? Resources.Max : Resources.Restore)
    {
      bm.MakeTransparent(Color.Magenta);
      e.Graphics.DrawImage(bm, rc);
    }
    rc = Rectangle.Round(closeButton.GetBounds());
    using (Bitmap bm = Resources.Close)
    {
      bm.MakeTransparent(Color.Magenta);
      e.Graphics.DrawImage(bm, rc);
    }

    using (Pen myPen = new Pen(Color.Orange, 2))
    {
      rc = this.DisplayRectangle;
      e.Graphics.DrawLine(myPen, rc.Left, rc.Top - 2, rc.Right, rc.Top - 2);
    }
    RectangleF textRect = titleBar.GetBounds();
    textRect.X += iconButton.GetBounds().Width + 3;
    textRect.Width = minButton.GetBounds().Left - textRect.Left;
    TextRenderer.DrawText(e.Graphics, this.Text, SystemFonts.CaptionFont, Rectangle.Round(textRect), Color.DarkGoldenrod, TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter);
    }
    protected override void OnTextChanged(EventArgs e)
    {
    base.OnTextChanged(e);
    this.Invalidate();
    }
    private void BuildPaths()
    {
    int edgeSize = SystemInformation.CaptionHeight + 2;
    int buttonSize = SystemFonts.CaptionFont.Height;
    int buttonPadding = 2;
    //Left Sizing Edge
    leftEdge.Reset();
    leftEdge.AddRectangle(new Rectangle(0, edgeSize, 5, this.Height - (edgeSize*2)));
    //Top Sizing Edge
    topEdge.Reset();
    topEdge.AddRectangle(new Rectangle(edgeSize, 0, this.Width - (edgeSize * 2), 5));
    //Right Sizing Edge
    rightEdge.Reset();
    rightEdge.AddRectangle(new Rectangle(this.Width - 5, edgeSize, 5, this.Height - (edgeSize * 2)));
    //Bottom Sizing Edge
    bottomEdge.Reset();
    bottomEdge.AddRectangle(new Rectangle(edgeSize, this.Height - 5, this.Width - (edgeSize * 2), 5));
    //Top-Left Sizing Edge
    topLeftEdge.Reset();
    topLeftEdge.AddRectangle(new Rectangle(0, 0, edgeSize, edgeSize));
    topLeftEdge.AddRectangle(new Rectangle(5, 5, edgeSize - 5, edgeSize - 5));
    //Top-Right Sizing Edge
    topRightEdge.Reset();
    topRightEdge.AddRectangle(new Rectangle(this.Width - edgeSize, 0, edgeSize, edgeSize));
    topRightEdge.AddRectangle(new Rectangle(this.Width - edgeSize, 5, edgeSize - 5, edgeSize - 5));
    //Bottom-Left Sizing Edge
    bottomLeftEdge.Reset();
    bottomLeftEdge.AddRectangle(new Rectangle(0, this.Height - edgeSize, edgeSize, edgeSize));
    bottomLeftEdge.AddRectangle(new Rectangle(5, this.Height - edgeSize, edgeSize - 5, edgeSize - 5));
    //Bottom-Right Sizing Edge
    bottomRightEdge.Reset();
    bottomRightEdge.AddRectangle(new Rectangle(this.Width - edgeSize, this.Height - edgeSize, edgeSize, edgeSize));
    bottomRightEdge.AddRectangle(new Rectangle(this.Width - edgeSize, this.Height - edgeSize, edgeSize - 5, edgeSize - 5));
    //Close Button
    closeButton.Reset();
    closeButton.AddRectangle(new Rectangle(this.Width - 5 - (buttonSize + buttonPadding), 8, buttonSize, buttonSize));
    //Maximize Button
    maxButton.Reset();
    maxButton.AddRectangle(new Rectangle(this.Width - 5 -((buttonSize + buttonPadding)*2), 8, buttonSize, buttonSize));
    //Minimize Button
    minButton.Reset();
    minButton.AddRectangle(new Rectangle(this.Width - 5 -((buttonSize + buttonPadding)*3), 8, buttonSize, buttonSize));
    //Window Menu Button (Icon)
    iconButton.Reset();
    iconButton.AddRectangle(new Rectangle(8, 8, buttonSize, buttonSize));
    //TitleBar
    titleBar.Reset();
    titleBar.AddRectangle(new Rectangle(5, 5, this.Width - 10, edgeSize-5));
    //Remove Titlebar Buttons from TitleBar Path
    titleBar.AddPath(closeButton, false);
    titleBar.AddPath(maxButton, false);
    titleBar.AddPath(minButton, false);
    titleBar.AddPath(iconButton, false);
    }
    [PermissionSet(SecurityAction.Demand, Name = &quot;FullTrust&quot;)]
    protected override void WndProc(ref Message m)
    {
    if (this.WindowState == FormWindowState.Maximized)
    {
      if (m.Msg == USER32.WM_SYSCOMMAND &amp;amp;&amp;amp;
        m.WParam.ToInt32() == (int)USER32.SysCommand.SC_MOVE ||
        m.Msg == (int)USER32.NCMouseMessage.WM_NCLBUTTONDOWN &amp;amp;&amp;amp;
        m.WParam.ToInt32() == (int)USER32.NCHitTestResult.HTCAPTION)
      {
        m.Msg = USER32.WM_NULL;
      }
    }
    base.WndProc(ref m);
    switch (m.Msg)
    {
      case (int)USER32.WM_GETSYSMENU:
        this.SystemMenu.Show(this, this.PointToClient(new Point(m.LParam.ToInt32())));
        break;
      case USER32.WM_NCACTIVATE:
        this.formActive = m.WParam.ToInt32() != 0;
        this.Invalidate();
        break;
      case USER32.WM_NCHITTEST:
        m.Result = OnNonClientHitTest(m.LParam);
        break;
      case (int) USER32.NCMouseMessage.WM_NCLBUTTONUP:
        OnNonClientLButtonUp(m.LParam);
        break;
      case (int)USER32.NCMouseMessage.WM_NCRBUTTONUP:
        OnNonClientRButtonUp(m.LParam);
        break;
      case (int)USER32.NCMouseMessage.WM_NCMOUSEMOVE:
        OnNonClientMouseMove(m.LParam);
        break;
      default:
        break;
    }
    }
    private void OnNonClientLButtonUp(IntPtr lParam)
    {
    USER32.SysCommand code = USER32.SysCommand.SC_DEFAULT;
    Point point = this.PointToClient(new Point(lParam.ToInt32()));
    if (this.iconButton.IsVisible(point))
    {
      this.TopMost = !this.TopMost;
      this.Invalidate();
    }
    else
    {
      if (this.closeButton.IsVisible(point))
        code = USER32.SysCommand.SC_CLOSE;
      else if (this.maxButton.IsVisible(point))
        code = this.WindowState == FormWindowState.Normal ? USER32.SysCommand.SC_MAXIMIZE : USER32.SysCommand.SC_RESTORE;
      else if (this.minButton.IsVisible(point))
        code = USER32.SysCommand.SC_MINIMIZE;
      SendNCWinMessage(USER32.WM_SYSCOMMAND, (IntPtr)code, IntPtr.Zero);
    }
    }
    private void OnNonClientRButtonUp(IntPtr lParam)
    {
    if (this.titleBar.IsVisible(this.PointToClient(new Point(lParam.ToInt32()))))
      SendNCWinMessage(USER32.WM_GETSYSMENU, IntPtr.Zero, lParam);
    }
    private void OnNonClientMouseMove(IntPtr lParam)
    {
    Point point = this.PointToClient(new Point(lParam.ToInt32()));
    String tooltip;
    if (this.closeButton.IsVisible(point))
      tooltip = &quot;Close&quot;;
    else if (this.maxButton.IsVisible(point))
      tooltip = this.WindowState == FormWindowState.Normal ? &quot;Maximize&quot; : &quot;Restore&quot;;
    else if (this.minButton.IsVisible(point))
      tooltip = &quot;Minimize&quot;;
    else if (this.iconButton.IsVisible(point))
      tooltip = this.TopMost ? &quot;Un-Pin&quot; : &quot;Pin&quot;;
    else
      tooltip = string.Empty;
    if (ButtonTip.GetToolTip(this) != tooltip)
      ButtonTip.SetToolTip(this, tooltip);
    }
    private IntPtr OnNonClientHitTest(IntPtr lParam)
    {
    USER32.NCHitTestResult result = USER32.NCHitTestResult.HTCLIENT;
    Point point = this.PointToClient(new Point(lParam.ToInt32()));
    if (this.titleBar.IsVisible(point))
    {
      result = USER32.NCHitTestResult.HTCAPTION;
    }
    if (this.WindowState == FormWindowState.Normal)
    {
      if (this.topLeftEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTTOPLEFT;
      else if (this.topEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTTOP;
      else if (this.topRightEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTTOPRIGHT;
      else if (this.leftEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTLEFT;
      else if (this.rightEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTRIGHT;
      else if (this.bottomLeftEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTBOTTOMLEFT;
      else if (this.bottomEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTBOTTOM;
      else if (this.bottomRightEdge.IsVisible(point))
        result = USER32.NCHitTestResult.HTBOTTOMRIGHT;
    }
    if (this.closeButton.IsVisible(point))
      result = USER32.NCHitTestResult.HTBORDER;
    else if (this.maxButton.IsVisible(point))
      result = USER32.NCHitTestResult.HTBORDER;
    else if (this.minButton.IsVisible(point))
      result = USER32.NCHitTestResult.HTBORDER;
    else if (this.iconButton.IsVisible(point))
      result = USER32.NCHitTestResult.HTBORDER;
    return (IntPtr)result;
    }
    private void SendNCWinMessage(int msg, IntPtr wParam, IntPtr lParam)
    {
    Message message = Message.Create(this.Handle, msg, wParam, lParam);
    this.WndProc(ref message);
    }
    protected void SystemMenu_SystemEvent(object sender, WindowMenuEventArgs ev)
    {
    SendNCWinMessage(USER32.WM_SYSCOMMAND, (IntPtr)ev.SystemCommand, IntPtr.Zero);
    }
  }
  internal sealed class USER32
  {
    private USER32()
    : base()
    {
    //Non-Instantiable class
    }
    public enum SysCommand
    {
    SC_SIZE = 0xF000,
    SC_MOVE = 0xF010,
    SC_MINIMIZE = 0xF020,
    SC_MAXIMIZE = 0xF030,
    SC_NEXTWINDOW = 0xF040,
    SC_PREVWINDOW = 0xF050,
    SC_CLOSE = 0xF060,
    SC_VSCROLL = 0xF070,
    SC_HSCROLL = 0xF080,
    SC_MOUSEMENU = 0xF090,
    SC_KEYMENU = 0xF100,
    SC_ARRANGE = 0xF110,
    SC_RESTORE = 0xF120,
    SC_TASKLIST = 0xF130,
    SC_SCREENSAVE = 0xF140,
    SC_HOTKEY = 0xF150,
    SC_DEFAULT = 0xF160,
    SC_MONITORPOWER = 0xF170,
    SC_CONTEXTHELP = 0xF180,
    SC_SEPARATOR = 0xF00F
    }
    public enum NCHitTestResult
    {
    HTERROR = (-2),
    HTTRANSPARENT,
    HTNOWHERE,
    HTCLIENT,
    HTCAPTION,
    HTSYSMENU,
    HTGROWBOX,
    HTMENU,
    HTHSCROLL,
    HTVSCROLL,
    HTMINBUTTON,
    HTMAXBUTTON,
    HTLEFT,
    HTRIGHT,
    HTTOP,
    HTTOPLEFT,
    HTTOPRIGHT,
    HTBOTTOM,
    HTBOTTOMLEFT,
    HTBOTTOMRIGHT,
    HTBORDER,
    HTOBJECT,
    HTCLOSE,
    HTHELP
    }
    public enum NCMouseMessage
    {
    WM_NCMOUSEMOVE = 0xA0,
    WM_NCLBUTTONDOWN = 0xA1,
    WM_NCLBUTTONUP = 0xA2,
    WM_NCLBUTTONDBLCLK = 0xA3,
    WM_NCRBUTTONDOWN = 0xA4,
    WM_NCRBUTTONUP = 0xA5,
    WM_NCRBUTTONDBLCLK = 0xA6,
    WM_NCMBUTTONDOWN = 0xA7,
    WM_NCMBUTTONUP = 0xA8,
    WM_NCMBUTTONDBLCLK = 0xA9,
    WM_NCXBUTTONDOWN = 0xAB,
    WM_NCXBUTTONUP = 0xAC,
    WM_NCXBUTTONDBLCLK = 0xAD
    }
    public const int WM_NULL = 0x0;
    public const int WM_NCHITTEST = 0x84;
    public const int WM_NCACTIVATE = 0x86;
    public const int WM_SYSCOMMAND = 0x112;
    public const int WM_ENTERMENULOOP = 0x211;
    public const int WM_EXITMENULOOP = 0x212;
    //********** Undocumented message **********
    public const int WM_GETSYSMENU = 0x313;
    //*****************************************
    public static IntPtr MakeLParam(int LoWord, int HiWord)
    {
    return (IntPtr)(((HiWord &amp;lt;&amp;lt; 16) | (LoWord &amp;amp; 0xFFFF)));
    }
  }
  internal sealed class WindowMenu : ContextMenu
  {
    private Form Owner;
    private MenuItem menuRestore, menuMove, menuSize, menuMin, menuMax, menuSep, menuClose;
    public event WindowMenuEventHandler SystemEvent;
    public WindowMenu(Form owner)
    : base()
    {
    Owner = owner;
    menuRestore = CreateMenuItem(&quot;Restore&quot;);
    menuMove = CreateMenuItem(&quot;Move&quot;);
    menuSize = CreateMenuItem(&quot;Size&quot;);
    menuMin = CreateMenuItem(&quot;Minimize&quot;);
    menuMax = CreateMenuItem(&quot;Maximize&quot;);
    menuSep = CreateMenuItem(&quot;-&quot;);
    menuClose = CreateMenuItem(&quot;Close&quot;, Shortcut.AltF4);
    this.MenuItems.AddRange(new MenuItem[] { menuRestore, menuMove, menuSize, menuMin, menuMax, menuSep, menuClose });
    menuClose.DefaultItem = true;
    }
    protected override void OnPopup(EventArgs e)
    {
    switch (Owner.WindowState)
    {
      case FormWindowState.Normal:
        menuRestore.Enabled = false;
        menuMax.Enabled = true;
        menuMin.Enabled = true;
        menuMove.Enabled = true;
        menuSize.Enabled = true;
        break;
      case FormWindowState.Minimized:
        menuRestore.Enabled = true;
        menuMax.Enabled = true;
        menuMin.Enabled = false;
        menuMove.Enabled = false;
        menuSize.Enabled = false;
        break;
      case FormWindowState.Maximized:
        menuRestore.Enabled = true;
        menuMax.Enabled = false;
        menuMin.Enabled = true;
        menuMove.Enabled = false;
        menuSize.Enabled = false;
        break;
    }
    base.OnPopup(e);
    }
    private void OnWindowMenuClick(object sender, EventArgs e)
    {
    switch (this.MenuItems.IndexOf((MenuItem)sender))
    {
      case 0:
        SendSysCommand(USER32.SysCommand.SC_RESTORE);
        break;
      case 1:
        SendSysCommand(USER32.SysCommand.SC_MOVE);
        break;
      case 2:
        SendSysCommand(USER32.SysCommand.SC_SIZE);
        break;
      case 3:
        SendSysCommand(USER32.SysCommand.SC_MINIMIZE);
        break;
      case 4:
        SendSysCommand(USER32.SysCommand.SC_MAXIMIZE);
        break;
      case 6:
        SendSysCommand(USER32.SysCommand.SC_CLOSE);
        break;
    }
    }
    private MenuItem CreateMenuItem(string text)
    {
    return CreateMenuItem(text, Shortcut.None);
    }
    private MenuItem CreateMenuItem(string text, Shortcut shortcut)
    {
    MenuItem item = new MenuItem(text, OnWindowMenuClick, shortcut);
    item.OwnerDraw = true;
    item.MeasureItem += new MeasureItemEventHandler(item_MeasureItem);
    item.DrawItem += new DrawItemEventHandler(item_DrawItem);
    return item;
    }
    void item_MeasureItem(object sender, MeasureItemEventArgs e)
    {
    MenuItem item = this.MenuItems[e.Index];
    String itemText = item.Text;
    itemText += &quot;/tAlt+F4&quot;;
    Size itemSize = TextRenderer.MeasureText(itemText, SystemFonts.MenuFont);
    e.ItemHeight = e.Index == 5 ? 8 : itemSize.Height + 7;
    e.ItemWidth = itemSize.Width + itemSize.Height + 23;
    }
    void item_DrawItem(object sender, DrawItemEventArgs e)
    {
    MenuItem item = this.MenuItems[e.Index];
    if (item.Enabled)
      e.DrawBackground();
    else
      e.Graphics.FillRectangle(SystemBrushes.Menu, e.Bounds);
    if (e.Index == 5)
      e.Graphics.DrawLine(SystemPens.GrayText, e.Bounds.Left + 2, e.Bounds.Top + 3, e.Bounds.Right - 2, e.Bounds.Top + 3);
    else
    {
      TextFormatFlags format = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.NoPadding;
      Color textColor = item.Enabled ? SystemColors.MenuText : SystemColors.GrayText;
      using (Font marlettFont = new Font(&quot;Marlett&quot;, 10))
      {
        Rectangle GlyphRect = e.Bounds;
        GlyphRect.Width = GlyphRect.Height;
        if (item == menuRestore)
        TextRenderer.DrawText(e.Graphics, &quot;2&quot;, marlettFont, GlyphRect, textColor, format);
        else if (item == menuMin)
        TextRenderer.DrawText(e.Graphics, &quot;0&quot;, marlettFont, GlyphRect, textColor, format);
        else if (item == menuMax)
        TextRenderer.DrawText(e.Graphics, &quot;1&quot;, marlettFont, GlyphRect, textColor, format);
        else if (item == menuClose)
        TextRenderer.DrawText(e.Graphics, &quot;r&quot;, marlettFont, GlyphRect, textColor, format);
      }
      format &amp;amp;= TextFormatFlags.Left | ~TextFormatFlags.HorizontalCenter;
      Rectangle textRect = new Rectangle(e.Bounds.Left + e.Bounds.Height + 3, e.Bounds.Top, e.Bounds.Width - e.Bounds.Height - 3, e.Bounds.Height);
      TextRenderer.DrawText(e.Graphics, item.Text, SystemFonts.MenuFont, textRect, textColor, format);
      if (item == menuClose)
      {
        String shortcut = &quot;Alt+F4&quot;;
        Size shortcutSize = TextRenderer.MeasureText(shortcut, SystemFonts.MenuFont);
        textRect.X = textRect.Right - shortcutSize.Width - 13;
        TextRenderer.DrawText(e.Graphics, shortcut, SystemFonts.MenuFont, textRect, textColor, format);
      }
    }
    }
    private void SendSysCommand(USER32.SysCommand command)
    {
    if (this.SystemEvent != null)
    {
      WindowMenuEventArgs ev = new WindowMenuEventArgs((int)command);
      this.SystemEvent(this, ev);
    }
    }
  }
  public class WindowMenuEventArgs : EventArgs
  {
    private int systemCommand;
    public int SystemCommand
    {
    get { return (int)this.systemCommand; }
    }
    public WindowMenuEventArgs(int command)
    : base()
    {
    this.systemCommand = command;
    }
  }
  public delegate void WindowMenuEventHandler(object sender, WindowMenuEventArgs ev);
}
        &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/2264563421751522168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/08/custom-form-appearance-with-standard.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/2264563421751522168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/2264563421751522168'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/08/custom-form-appearance-with-standard.html' title='Custom Form Appearance With Standard Behaviour'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZU-a2NuRivoQIuYLmR8XvlUnZZr5M4m0AlUSjDeuCudcnuKr0eO24Qqvp_O4ooqI-7jdK2tBqdWkRLexetZwyHnP6XD_qEJYgi3K8A_43FSf3oHPR59BqqjWR1M3Isg4t2CINHUVnN1U/s72-c/Custom+Form+Appearance+With+Standard+Behaviour.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-7074608882490659850</id><published>2011-07-31T10:05:00.000-07:00</published><updated>2011-07-31T10:05:18.522-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Form"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Shaped Form Resizable and Moveable</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTGqf7809GsSVqT4jSekGgImmeNfzACCZJyvulYwV7Ps_OgROLz-AeeSv-7eXX5SUbepSIWYcPtP1fm5RIlrRTbdqPyy4L-jwlJ1Iilr8XQejBNI3uH1JRSLfTiUboKkAsfeETcdb5R10/s1600/Shaped+Form+Resizable+and+Moveable.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Shaped Form Resizable and Moveable&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTGqf7809GsSVqT4jSekGgImmeNfzACCZJyvulYwV7Ps_OgROLz-AeeSv-7eXX5SUbepSIWYcPtP1fm5RIlrRTbdqPyy4L-jwlJ1Iilr8XQejBNI3uH1JRSLfTiUboKkAsfeETcdb5R10/s1600/Shaped+Form+Resizable+and+Moveable.png&quot; title=&quot;Shaped Form Resizable and Moveable&quot; /&gt;&lt;/a&gt;&lt;/div&gt;This is by no means a complete solution, just an idea for creating custom shaped forms with custom Titlebars.&lt;br /&gt;
The form can be dragged by its fake titlebar, and if right clicked the fake Titlebar will popup the WindowMenu.&lt;br /&gt;
The CreateParams property has been modified to add a System Menu (with Min,Move and Close items) to a borderless form.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
The Titlebar button are not controls, they are simply drawn in the fake title bar and they react to hittesting.&lt;br /&gt;
The MainMenu is actually labels that popup Contextmenus.&lt;br /&gt;
The form can be resized only by its resizegrip, but you could define regions for each of the sides and corners and allow sizing by dragging the edge. The example requires a little work to be useable, but it should give you an idea of how to achieve this solution.&lt;br /&gt;
With a little InterOp you can draw a standard TitleBar onto which you can place custom buttons, and this solution is much simpler than that of OwnerDrawing the NonClient Area to achieve the same effect. &lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Imports System.Drawing.Drawing2D
Public Class MainForm
  Inherits System.Windows.Forms.Form
#Region &quot; Windows Form Designer generated code &quot;
  &amp;lt;System.STAThread()&amp;gt; _
  Public Shared Sub Main()
    Application.EnableVisualStyles()
    Application.DoEvents()
    Application.Run(New MainForm)
  End Sub
  Public Sub New()
    MyBase.New()
    &#39;This call is required by the Windows Form Designer.
    InitializeComponent()
    &#39;Add any initialization after the InitializeComponent() call
    setstyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.DoubleBuffer Or ControlStyles.ResizeRedraw Or ControlStyles.UserPaint, True)
  End Sub
  &#39;Form overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
    If disposing Then
    If Not (components Is Nothing) Then
      components.Dispose()
    End If
    End If
    MyBase.Dispose(disposing)
  End Sub
  &#39;Required by the Windows Form Designer
  Private components As System.ComponentModel.IContainer
  &#39;NOTE: The following procedure is required by the Windows Form Designer
  &#39;It can be modified using the Windows Form Designer.  
  &#39;Do not modify it using the code editor.
  Friend WithEvents ContextMenu1 As System.Windows.Forms.ContextMenu
  Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
  Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
  Friend WithEvents ContextMenu2 As System.Windows.Forms.ContextMenu
  Friend WithEvents MenuExit As System.Windows.Forms.MenuItem
  Friend WithEvents MenuAbout As System.Windows.Forms.MenuItem
  Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
  Friend WithEvents LabelFile As System.Windows.Forms.Label
  Friend WithEvents LabelResize As System.Windows.Forms.Label
  Friend WithEvents LabelHelp As System.Windows.Forms.Label
  &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()
    Me.components = New System.ComponentModel.Container
    Me.ContextMenu1 = New System.Windows.Forms.ContextMenu
    Me.MenuItem1 = New System.Windows.Forms.MenuItem
    Me.MenuItem2 = New System.Windows.Forms.MenuItem
    Me.MenuExit = New System.Windows.Forms.MenuItem
    Me.ContextMenu2 = New System.Windows.Forms.ContextMenu
    Me.MenuAbout = New System.Windows.Forms.MenuItem
    Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
    Me.LabelFile = New System.Windows.Forms.Label
    Me.LabelHelp = New System.Windows.Forms.Label
    Me.LabelResize = New System.Windows.Forms.Label
    Me.SuspendLayout()
    &#39;
    &#39;ContextMenu1
    &#39;
    Me.ContextMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2, Me.MenuExit})
    &#39;
    &#39;MenuItem1
    &#39;
    Me.MenuItem1.Index = 0
    Me.MenuItem1.Text = &quot;MenuItem1&quot;
    &#39;
    &#39;MenuItem2
    &#39;
    Me.MenuItem2.Index = 1
    Me.MenuItem2.Text = &quot;-&quot;
    &#39;
    &#39;MenuExit
    &#39;
    Me.MenuExit.Index = 2
    Me.MenuExit.Text = &quot;Exit&quot;
    &#39;
    &#39;ContextMenu2
    &#39;
    Me.ContextMenu2.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuAbout})
    &#39;
    &#39;MenuAbout
    &#39;
    Me.MenuAbout.Index = 0
    Me.MenuAbout.Text = &quot;About&quot;
    &#39;
    &#39;ToolTip1
    &#39;
    Me.ToolTip1.ShowAlways = True
    &#39;
    &#39;LabelFile
    &#39;
    Me.LabelFile.BackColor = System.Drawing.Color.Transparent
    Me.LabelFile.ForeColor = System.Drawing.SystemColors.MenuText
    Me.LabelFile.Location = New System.Drawing.Point(8, 24)
    Me.LabelFile.Name = &quot;LabelFile&quot;
    Me.LabelFile.Size = New System.Drawing.Size(32, 19)
    Me.LabelFile.TabIndex = 0
    Me.LabelFile.Text = &quot;File&quot;
    Me.LabelFile.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    &#39;
    &#39;LabelHelp
    &#39;
    Me.LabelHelp.BackColor = System.Drawing.Color.Transparent
    Me.LabelHelp.ForeColor = System.Drawing.SystemColors.MenuText
    Me.LabelHelp.Location = New System.Drawing.Point(64, 24)
    Me.LabelHelp.Name = &quot;LabelHelp&quot;
    Me.LabelHelp.Size = New System.Drawing.Size(32, 19)
    Me.LabelHelp.TabIndex = 1
    Me.LabelHelp.Text = &quot;Help&quot;
    Me.LabelHelp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
    &#39;
    &#39;LabelResize
    &#39;
    Me.LabelResize.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
    Me.LabelResize.AutoSize = True
    Me.LabelResize.BackColor = System.Drawing.Color.Transparent
    Me.LabelResize.Font = New System.Drawing.Font(&quot;Marlett&quot;, 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(2, Byte))
    Me.LabelResize.Location = New System.Drawing.Point(272, 138)
    Me.LabelResize.Name = &quot;LabelResize&quot;
    Me.LabelResize.Size = New System.Drawing.Size(16, 14)
    Me.LabelResize.TabIndex = 2
    Me.LabelResize.Text = &quot;o&quot;
    &#39;
    &#39;MainForm
    &#39;
    Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
    Me.ClientSize = New System.Drawing.Size(288, 152)
    Me.Controls.Add(Me.LabelResize)
    Me.Controls.Add(Me.LabelHelp)
    Me.Controls.Add(Me.LabelFile)
    Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
    Me.Name = &quot;MainForm&quot;
    Me.Text = &quot;Shaped Form Example&quot;
    Me.ResumeLayout(False)
  End Sub
#End Region
  Private ReadOnly Property TitleBar() As Region
    Get
    Return New Region(New Rectangle(0, 0, Width, 26))
    End Get
  End Property
  Private ReadOnly Property CloseButton() As GraphicsPath
    Get
    Dim gp As New GraphicsPath
    gp.AddEllipse(New Rectangle(Width - 26, 3, 18, 18))
    Return gp
    End Get
  End Property
  Private ReadOnly Property MinButton() As GraphicsPath
    Get
    Dim gp As New GraphicsPath
    gp.AddEllipse(New Rectangle(Width - 49, 3, 18, 18))
    Return gp
    End Get
  End Property
  Private ReadOnly Property FormShape() As GraphicsPath
    Get
    Dim gp As GraphicsPath = New GraphicsPath
    Dim r As Rectangle = ClientRectangle
    Dim radius As Int32 = 12
    gp.AddArc(r.Left, r.Top + 24, radius, radius, 180, 90)
    gp.AddArc(r.Left + 80 - radius, r.Top + 24 - radius, radius, radius, -270, -90)
    gp.AddArc(r.Left + 80, r.Top, radius, radius, 180, 90)
    gp.AddArc(r.Right - radius, r.Top, radius, radius, 270, 90)
    gp.AddArc(r.Right - radius, r.Bottom - radius, radius, radius, 0, 90)
    gp.AddArc(r.Left, r.Bottom - radius, radius, radius, 90, 90)
    gp.CloseFigure()
    Return gp
    End Get
  End Property
  Private ClosePress As Boolean = False
  Private MinPress As Boolean = False
  Private FormDrag As Boolean = False
  Private FileActive As Boolean = False
  Private HelpActive As Boolean = False
  Private FileHot As Boolean = False
  Private HelpHot As Boolean = False
  Private Const WM_NCLBUTTONDOWN As Integer = &amp;amp;HA1
  Private Const HT_CAPTION As Integer = &amp;amp;H2
  Protected Overrides ReadOnly Property CreateParams() As System.Windows.Forms.CreateParams
    Get
    Dim cp As CreateParams = MyBase.CreateParams
    Const WS_CLIPCHILDREN As Integer = &amp;amp;H2000000
    Const WS_MINIMIZEBOX As Integer = &amp;amp;H20000
    &#39;Const WS_MAXIMIZEBOX As Integer = &amp;amp;H10000
    Const WS_SYSMENU As Integer = &amp;amp;H80000
    Const CS_DBLCLKS As Integer = &amp;amp;H8
    Const CS_DROPSHADOW As Integer = &amp;amp;H20000
    Dim ClassFlags As Integer = CS_DBLCLKS
    Dim OSVER As Integer = Environment.OSVersion.Version.Major * 10
    OSVER += Environment.OSVersion.Version.Minor
    If OSVER &amp;gt;= 51 Then ClassFlags = CS_DBLCLKS Or CS_DROPSHADOW
    cp.Style = WS_CLIPCHILDREN Or WS_MINIMIZEBOX Or WS_SYSMENU &#39;Or WS_MAXIMIZEBOX
    cp.ClassStyle = ClassFlags
    Return cp
    End Get
  End Property
  Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.LabelFile.Location = New Point(2, 26)
    Me.LabelHelp.Location = New Point(LabelFile.Right, 26)
    Me.LabelFile.Font = SystemInformation.MenuFont
    Me.LabelHelp.Font = SystemInformation.MenuFont
    Me.Region = New Region(FormShape)
  End Sub
  Private Sub MainForm_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
    e.Graphics.FillRegion(Brushes.Green, TitleBar)
    e.Graphics.FillRectangle(SystemBrushes.Menu, New Rectangle(0, 26, Width, 19))
    If FileHot Then e.Graphics.FillRectangle(SystemBrushes.Highlight, LabelFile.Bounds)
    If HelpHot Then e.Graphics.FillRectangle(SystemBrushes.Highlight, LabelHelp.Bounds)
    Dim BorderPen As New Pen(Color.Green, 2)
    BorderPen.Alignment = PenAlignment.Inset
    e.Graphics.DrawPath(BorderPen, FormShape)
    BorderPen.Dispose()
    e.Graphics.SmoothingMode = SmoothingMode.HighQuality
    Dim sf As New StringFormat(StringFormatFlags.NoWrap)
    sf.Trimming = StringTrimming.EllipsisCharacter
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Center
    e.Graphics.DrawString(Me.Text, Control.DefaultFont, Brushes.White, RectangleF.FromLTRB(84, 0, MinButton.GetBounds.X, 24), sf)
    If ClosePress Then
    e.Graphics.FillPath(Brushes.Blue, CloseButton)
    Else
    e.Graphics.FillPath(Brushes.Red, CloseButton)
    End If
    If MinPress Then
    e.Graphics.FillPath(Brushes.Red, MinButton)
    Else
    e.Graphics.FillPath(Brushes.Yellow, MinButton)
    End If
    Dim GlyphFont As New Font(&quot;marlett&quot;, Font.SizeInPoints, FontStyle.Bold, GraphicsUnit.Point)
    e.Graphics.DrawString(&quot;0&quot;, GlyphFont, Brushes.Black, MinButton.GetBounds, sf)
    e.Graphics.DrawString(&quot;r&quot;, GlyphFont, Brushes.Black, CloseButton.GetBounds, sf)
    GlyphFont.Dispose()
  End Sub
  Private Sub MainForm_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
    ClosePress = CloseButton.IsVisible(e.X, e.Y) AndAlso e.Button = MouseButtons.Left
    MinPress = MinButton.IsVisible(e.X, e.Y) AndAlso e.Button = MouseButtons.Left
    FormDrag = TitleBar.IsVisible(e.X, e.Y) AndAlso _
        e.Button = MouseButtons.Left AndAlso _
        ClosePress = False AndAlso MinPress = False
    If FormDrag Then
    Me.Capture = False
    WndProc(Message.Create(Handle, WM_NCLBUTTONDOWN, IntPtr.op_Explicit(HT_CAPTION), IntPtr.Zero))
    End If
    Invalidate()
  End Sub
  Private Sub MainForm_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
    Dim OverClose, OverMin As Boolean
    OverClose = CloseButton.IsVisible(e.X, e.Y)
    OverMin = MinButton.IsVisible(e.X, e.Y)
    ClosePress = OverClose AndAlso e.Button = MouseButtons.Left
    MinPress = OverMin AndAlso e.Button = MouseButtons.Left
    If OverClose AndAlso ClosePress = False Then
    ToolTip1.SetToolTip(Me, &quot;Close&quot;)
    ElseIf OverMin AndAlso MinPress = False Then
    ToolTip1.SetToolTip(Me, &quot;Minimize&quot;)
    Else
    ToolTip1.SetToolTip(Me, &quot;&quot;)
    End If
    Invalidate()
  End Sub
  Private Sub MainForm_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
    Dim OverClose, OverMin As Boolean
    OverClose = CloseButton.IsVisible(e.X, e.Y)
    OverMin = MinButton.IsVisible(e.X, e.Y)
    If OverClose AndAlso ClosePress AndAlso e.Button = MouseButtons.Left Then
    Me.Close()
    End If
    If OverMin AndAlso MinPress AndAlso e.Button = MouseButtons.Left Then
    Me.WindowState = FormWindowState.Minimized
    End If
    If e.Button = MouseButtons.Right AndAlso TitleBar.IsVisible(e.X, e.Y) Then
    If OverClose = False AndAlso OverMin = False Then
      Const WM_GETSYSMENU As Integer = &amp;amp;H313
      If e.Button = MouseButtons.Right Then
        Dim pos As Point = Me.PointToScreen(New Point(e.X, e.Y))
        Dim hPos As IntPtr = IntPtr.op_Explicit(CInt((pos.Y * &amp;amp;H10000) Or (pos.X And &amp;amp;HFFFF&amp;amp;)))
        WndProc(Message.Create(Handle, WM_GETSYSMENU, IntPtr.Zero, hPos))
      End If
    End If
    End If
    ClosePress = False
    MinPress = False
    FormDrag = False
    Invalidate()
  End Sub
  Private Sub MenuAbout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuAbout.Click
    MessageBox.Show(&quot;Shaped Form Example!&quot; &amp;amp; vbCrLf &amp;amp; &quot;By Mick Doherty (http://dotnetrix.co.uk)&quot;, &quot;About...&quot;, MessageBoxButtons.OK)
  End Sub
  Private Sub MenuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuExit.Click
    Application.Exit()
  End Sub
  Private Sub LabelHelp_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles LabelHelp.MouseEnter
    HelpHot = True
    LabelHelp.ForeColor = SystemColors.HighlightText
    Invalidate()
  End Sub
  Private Sub LabelHelp_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LabelHelp.MouseUp
    HelpActive = True
    ContextMenu2.Show(LabelHelp, New Point(0, LabelHelp.Height))
    HelpActive = False
    LabelHelp.ForeColor = SystemColors.MenuText
    Invalidate()
  End Sub
  Private Sub LabelHelp_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles LabelHelp.MouseLeave
    If HelpActive = False Then
    HelpHot = False
    LabelHelp.ForeColor = SystemColors.MenuText
    End If
    Invalidate()
  End Sub
  Private Sub LabelFile_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles LabelFile.MouseEnter
    FileHot = True
    LabelFile.ForeColor = SystemColors.HighlightText
    Invalidate()
  End Sub
  Private Sub LabelFile_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LabelFile.MouseUp
    FileActive = True
    ContextMenu1.Show(LabelFile, New Point(0, LabelFile.Height))
    FileActive = False
    LabelFile.ForeColor = SystemColors.MenuText
    Invalidate()
  End Sub
  Private Sub LabelFile_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles LabelFile.MouseLeave
    If FileActive = False Then
    FileHot = False
    LabelFile.ForeColor = SystemColors.MenuText
    End If
    Invalidate()
  End Sub
  Private Sizing As Boolean = False
  Private SizeOffset As Point = Point.Empty
  Private Sub LabelResize_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LabelResize.MouseDown
    Sizing = True
    SizeOffset = New Point(Me.Right - Cursor.Position.X, Me.Bottom - Cursor.Position.Y)
  End Sub
  Private Sub LabelResize_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LabelResize.MouseMove
    If Sizing = True Then
    &#39;Clip cursor to dissallow sizing of form below 250x100
    Dim ClipRectangle As Rectangle = RectangleToScreen(New Rectangle(250, 100, Width, Height))
    ClipRectangle.Offset(SizeOffset)
    Cursor.Clip = ClipRectangle
    Me.Size = New Size(Cursor.Position.X + SizeOffset.X - Location.X, Cursor.Position.Y + SizeOffset.Y - Location.Y)
    End If
  End Sub
  Private Sub LabelResize_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles LabelResize.MouseUp
    Sizing = False
    Cursor.Clip = Nothing
  End Sub
  Private Sub MainForm_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize
    Me.Region = New Region(FormShape)
  End Sub
End Class
        
&lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Drawing.Drawing2D;
namespace ShapedForm
{
  /// &amp;lt;summary&amp;gt;
  /// Summary description for Form1.
  /// &amp;lt;/summary&amp;gt;
  public class MainForm : System.Windows.Forms.Form
  {
    private System.ComponentModel.IContainer components;
    public MainForm()
    {
    //
    // Required for Windows Form Designer support
    //
    InitializeComponent();
    //
    // TODO: Add any constructor code after InitializeComponent call
    //
    this.SetStyle(ControlStyles.AllPaintingInWmPaint| ControlStyles.DoubleBuffer|ControlStyles.UserPaint|ControlStyles.ResizeRedraw,true);
    }
    /// &amp;lt;summary&amp;gt;
    /// Clean up any resources being used.
    /// &amp;lt;/summary&amp;gt;
    protected override void Dispose( bool disposing )
    {
    if( disposing )
    {
      if (components != null) 
      {
        components.Dispose();
      }
    }
    base.Dispose( disposing );
    }
    #region Windows Form Designer generated code
    /// &amp;lt;summary&amp;gt;
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// &amp;lt;/summary&amp;gt;
    private void InitializeComponent()
    {
    this.components = new System.ComponentModel.Container();
    this.labelFile = new System.Windows.Forms.Label();
    this.labelHelp = new System.Windows.Forms.Label();
    this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
    this.contextMenu1 = new System.Windows.Forms.ContextMenu();
    this.menuItem1 = new System.Windows.Forms.MenuItem();
    this.menuItem2 = new System.Windows.Forms.MenuItem();
    this.menuExit = new System.Windows.Forms.MenuItem();
    this.contextMenu2 = new System.Windows.Forms.ContextMenu();
    this.menuAbout = new System.Windows.Forms.MenuItem();
    this.labelResize = new System.Windows.Forms.Label();
    this.SuspendLayout();
    // 
    // labelFile
    //
    this.labelFile.BackColor = System.Drawing.Color.Transparent;
    this.labelFile.ForeColor = System.Drawing.SystemColors.MenuText;
    this.labelFile.Location = new System.Drawing.Point(8, 24);
    this.labelFile.Name = &quot;labelFile&quot;;
    this.labelFile.Size = new System.Drawing.Size(32, 19);
    this.labelFile.TabIndex = 0;
    this.labelFile.Text = &quot;File&quot;;
    this.labelFile.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
    this.labelFile.MouseEnter += new System.EventHandler(this.labelFile_MouseEnter);
    this.labelFile.MouseUp += new System.Windows.Forms.MouseEventHandler(this.labelFile_MouseUp);
    this.labelFile.MouseLeave += new System.EventHandler(this.labelFile_MouseLeave);
    // 
    // labelHelp
    //
    this.labelHelp.BackColor = System.Drawing.Color.Transparent;
    this.labelHelp.ForeColor = System.Drawing.SystemColors.MenuText;
    this.labelHelp.Location = new System.Drawing.Point(64, 24);
    this.labelHelp.Name = &quot;labelHelp&quot;;
    this.labelHelp.Size = new System.Drawing.Size(32, 19);
    this.labelHelp.TabIndex = 1;
    this.labelHelp.Text = &quot;Help&quot;;
    this.labelHelp.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
    this.labelHelp.MouseEnter += new System.EventHandler(this.labelHelp_MouseEnter);
    this.labelHelp.MouseUp += new System.Windows.Forms.MouseEventHandler(this.labelHelp_MouseUp);
    this.labelHelp.MouseLeave += new System.EventHandler(this.labelHelp_MouseLeave);
    // 
    // contextMenu1
    // 
    this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                               this.menuItem1,
                               this.menuItem2,
                               this.menuExit});
    // 
    // menuItem1
    //
    this.menuItem1.Index = 0;
    this.menuItem1.Text = &quot;menuItem1&quot;;
    // 
    // menuItem2
    // 
    this.menuItem2.Index = 1;
    this.menuItem2.Text = &quot;-&quot;;
    // 
    // menuExit
    // 
    this.menuExit.Index = 2;
    this.menuExit.Text = &quot;Exit&quot;;
    this.menuExit.Click += new System.EventHandler(this.menuExit_Click);
    // 
    // contextMenu2
    //
    this.contextMenu2.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                               this.menuAbout});
    // 
    // menuAbout
    // 
    this.menuAbout.Index = 0;
    this.menuAbout.Text = &quot;About&quot;;
    this.menuAbout.Click += new System.EventHandler(this.menuAbout_Click);
    // 
    // labelResize
    //
    this.labelResize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
    this.labelResize.AutoSize = true;
    this.labelResize.BackColor = System.Drawing.Color.Transparent;
    this.labelResize.Font = new System.Drawing.Font(&quot;Marlett&quot;, 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(2)));
    this.labelResize.Location = new System.Drawing.Point(272, 138);
    this.labelResize.Name = &quot;labelResize&quot;;
    this.labelResize.Size = new System.Drawing.Size(16, 14);
    this.labelResize.TabIndex = 2;
    this.labelResize.Text = &quot;o&quot;;
    this.labelResize.MouseUp += new System.Windows.Forms.MouseEventHandler(this.labelResize_MouseUp);
    this.labelResize.MouseMove += new System.Windows.Forms.MouseEventHandler(this.labelResize_MouseMove);
    this.labelResize.MouseDown += new System.Windows.Forms.MouseEventHandler(this.labelResize_MouseDown);
     // 
    // MainForm
    //
    this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
    this.ClientSize = new System.Drawing.Size(288, 152);
    this.Controls.Add(this.labelResize);
    this.Controls.Add(this.labelHelp);
    this.Controls.Add(this.labelFile);
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.Name = &quot;Form1&quot;;
    this.Text = &quot;Shaped Form Example&quot;;
    this.Resize += new System.EventHandler(this.MainForm_Resize);
    this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
    this.Load += new System.EventHandler(this.Form1_Load);
    this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
    this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
    this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
    this.ResumeLayout(false);
    }
    #endregion
    /// &amp;lt;summary&amp;gt;
    /// The main entry point for the application.
    /// &amp;lt;/summary&amp;gt;
    [STAThread]
    static void Main() 
    {
    Application.Run(new MainForm());
    }

    private Region TitleBar
    {
    get{return new Region(new Rectangle(0, 0, Width, 26));}
    }

    private GraphicsPath CloseButton
    {
    get
    {
      GraphicsPath gp = new  GraphicsPath();
      gp.AddEllipse(new Rectangle(Width - 26, 3, 18, 18));
      return gp;
    }
    }

    private GraphicsPath MinButton
    {
    get
    {
      GraphicsPath gp = new GraphicsPath();
      gp.AddEllipse(new Rectangle(Width - 49, 3, 18, 18));
      return gp;
    }
    }

    private GraphicsPath FormShape
    {
    get
    {
      GraphicsPath gp = new GraphicsPath();
      Rectangle  r = ClientRectangle;
      int radius = 12;
          
      gp.AddArc(r.Left, r.Top + 24, radius, radius, 180, 90);
      gp.AddArc(r.Left + 80 - radius, r.Top + 24 - radius, radius, radius, -270, -90);
      gp.AddArc(r.Left + 80, r.Top, radius, radius, 180, 90);
      gp.AddArc(r.Right - radius, r.Top, radius, radius, 270, 90);
      gp.AddArc(r.Right - radius, r.Bottom - radius, radius, radius, 0, 90);
      gp.AddArc(r.Left, r.Bottom - radius, radius, radius, 90, 90);
      gp.CloseFigure();
          
      return gp;
    }
    }

    private bool ClosePress = false;
    private bool MinPress = false;
    private bool FormDrag = false;
    private bool FileActive = false;
    private bool HelpActive = false;
    private bool FileHot = false;
    private bool HelpHot = false;
    private const int WM_NCLBUTTONDOWN = 0xA1;
    private System.Windows.Forms.Label labelFile;
    private System.Windows.Forms.Label labelHelp;
    private System.Windows.Forms.ToolTip toolTip1;
    private System.Windows.Forms.ContextMenu contextMenu1;
    private System.Windows.Forms.ContextMenu contextMenu2;
    private System.Windows.Forms.MenuItem menuItem1;
    private System.Windows.Forms.MenuItem menuItem2;
    private System.Windows.Forms.MenuItem menuAbout;
    private System.Windows.Forms.MenuItem menuExit;
    private System.Windows.Forms.Label labelResize;
    private const int HT_CAPTION = 0x2;
    protected override  System.Windows.Forms.CreateParams CreateParams
    {
    get
    {
      CreateParams cp = base.CreateParams;
      const int WS_CLIPCHILDREN = 0x2000000;
      const int WS_MINIMIZEBOX = 0x20000;
      //const int WS_MAXIMIZEBOX = 0x10000;
      const int WS_SYSMENU = 0x80000;
      const int CS_DBLCLKS = 0x8;
      const int CS_DROPSHADOW = 0x20000;
      
      int ClassFlags = CS_DBLCLKS;
      int OSVER = Environment.OSVersion.Version.Major * 10;
      OSVER += Environment.OSVersion.Version.Minor;
      if (OSVER &amp;gt;= 51) ClassFlags = CS_DBLCLKS | CS_DROPSHADOW;
      
      cp.Style = WS_CLIPCHILDREN | WS_MINIMIZEBOX | WS_SYSMENU; //| WS_MAXIMIZEBOX
      cp.ClassStyle = ClassFlags;
      
      return cp;
    }
    }

    private void Form1_Load(object sender, System.EventArgs e)
    {
    this.labelFile.Location = new Point(2, 26);
    this.labelHelp.Location = new Point(labelFile.Right, 26);
    this.labelFile.Font = SystemInformation.MenuFont;
    this.labelHelp.Font = SystemInformation.MenuFont;
    this.Region = new Region(FormShape);  
    }

    private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
    {
    e.Graphics.FillRegion(Brushes.Green, TitleBar);
    e.Graphics.FillRectangle(SystemBrushes.Menu, new Rectangle(0, 26, Width, 19));
    if (FileHot) e.Graphics.FillRectangle(SystemBrushes.Highlight, labelFile.Bounds);
    if (HelpHot) e.Graphics.FillRectangle(SystemBrushes.Highlight, labelHelp.Bounds);
    Pen BorderPen = new Pen(Color.Green, 2);
    BorderPen.Alignment = PenAlignment.Inset;
    e.Graphics.DrawPath(BorderPen, FormShape);
    BorderPen.Dispose();
    
    e.Graphics.SmoothingMode = SmoothingMode.HighQuality;
    
    StringFormat sf= new StringFormat(StringFormatFlags.NoWrap);
    sf.Trimming = StringTrimming.EllipsisCharacter;
    sf.Alignment = StringAlignment.Center;
    sf.LineAlignment = StringAlignment.Center;
    
    e.Graphics.DrawString(this.Text, Control.DefaultFont, Brushes.White, RectangleF.FromLTRB(84, 0, MinButton.GetBounds().X, 24), sf);
    
    if (ClosePress)
      e.Graphics.FillPath(Brushes.Blue, CloseButton);
    else
      e.Graphics.FillPath(Brushes.Red, CloseButton);
    
    if (MinPress)
      e.Graphics.FillPath(Brushes.Red, MinButton);
    else
      e.Graphics.FillPath(Brushes.Yellow, MinButton);
    
    Font GlyphFont = new Font(&quot;marlett&quot;, Font.SizeInPoints, FontStyle.Bold, GraphicsUnit.Point);
    e.Graphics.DrawString(&quot;0&quot;, GlyphFont, Brushes.Black, MinButton.GetBounds(), sf);
    e.Graphics.DrawString(&quot;r&quot;, GlyphFont, Brushes.Black, CloseButton.GetBounds(), sf);
    GlyphFont.Dispose();
    
    }
    
    private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    ClosePress = CloseButton.IsVisible(e.X, e.Y) &amp;amp;&amp;amp; e.Button == MouseButtons.Left;
    MinPress = MinButton.IsVisible(e.X, e.Y) &amp;amp;&amp;amp; e.Button == MouseButtons.Left;
    FormDrag = TitleBar.IsVisible(e.X, e.Y) &amp;amp;&amp;amp;
    e.Button == MouseButtons.Left &amp;amp;&amp;amp;
      ClosePress == false &amp;amp;&amp;amp; MinPress == false;
    if (FormDrag)
    {
    this.Capture = false;
    Message msg = Message.Create(Handle, WM_NCLBUTTONDOWN, (IntPtr)HT_CAPTION, IntPtr.Zero);
    WndProc(ref msg);
    }
    Invalidate();
    }

    private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    bool OverClose, OverMin;
    OverClose = CloseButton.IsVisible(e.X, e.Y);
    OverMin = MinButton.IsVisible(e.X, e.Y);
    ClosePress = OverClose &amp;amp;&amp;amp; e.Button == MouseButtons.Left;
    MinPress = OverMin &amp;amp;&amp;amp; e.Button == MouseButtons.Left;
    
    if (OverClose &amp;amp;&amp;amp; ClosePress == false)
      toolTip1.SetToolTip(this, &quot;Close&quot;);
    else if (OverMin &amp;amp;&amp;amp; MinPress == false)
      toolTip1.SetToolTip(this, &quot;Minimize&quot;);
    else
      toolTip1.SetToolTip(this, &quot;&quot;);
    
    Invalidate();
    }

    private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    bool OverClose, OverMin;
    OverClose = CloseButton.IsVisible(e.X, e.Y);
    OverMin = MinButton.IsVisible(e.X, e.Y);
    
    if (OverClose &amp;amp;&amp;amp; ClosePress &amp;amp;&amp;amp; e.Button == MouseButtons.Left)
      this.Close();
    if (OverMin &amp;amp;&amp;amp; MinPress &amp;amp;&amp;amp; e.Button == MouseButtons.Left)
      this.WindowState = FormWindowState.Minimized;
    
    if (e.Button == MouseButtons.Right &amp;amp;&amp;amp; TitleBar.IsVisible(e.X, e.Y))
    {
      if (OverClose == false &amp;amp;&amp;amp; OverMin == false)
      {
      const int WM_GETSYSMENU = 0x313;
        if (e.Button == MouseButtons.Right)
        {
        Point pos = this.PointToScreen(new Point(e.X, e.Y));
        IntPtr hPos = (IntPtr)((int)((pos.Y * 0x10000) | (pos.X &amp;amp; 0xFFFF)));
        Message msg = Message.Create(this.Handle, WM_GETSYSMENU, IntPtr.Zero, hPos);
        WndProc(ref msg);
        }
      }
    }
    ClosePress = false;
    MinPress = false;
    FormDrag = false;
    Invalidate();
    }
  
    private void menuAbout_Click(object sender, System.EventArgs e)
    {
    MessageBox.Show(&quot;Shaped Form Example!\nBy Mick Doherty (http://dotnetrix.co.uk)&quot;, &quot;About...&quot;, MessageBoxButtons.OK);
    }

    private void menuExit_Click(object sender, System.EventArgs e)
    {
    Application.Exit();
    }

    private void labelHelp_MouseEnter(object sender, System.EventArgs e)
    {
    HelpHot = true;
    labelHelp.ForeColor = SystemColors.HighlightText;
    Invalidate();
    }

    private void labelHelp_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    HelpActive = true;
    contextMenu2.Show(labelHelp, new Point(0, labelHelp.Height));
    HelpActive = false;
    labelHelp.ForeColor = SystemColors.MenuText;
    Invalidate();
    }

    private void labelHelp_MouseLeave(object sender, System.EventArgs e)
    {
    if (HelpActive == false)
    {
      HelpHot = false;
      labelHelp.ForeColor = SystemColors.MenuText;
    }
    Invalidate();
    }

    private void labelFile_MouseEnter(object sender, System.EventArgs e)
    {
    FileHot = true;
    labelFile.ForeColor = SystemColors.HighlightText;
    Invalidate();
    }

    private void labelFile_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    FileActive = true;
    contextMenu1.Show(labelFile, new Point(0, labelFile.Height));
    FileActive = false;
    labelFile.ForeColor = SystemColors.MenuText;
    Invalidate();
    }

    private void labelFile_MouseLeave(object sender, System.EventArgs e)
    {
    if (FileActive == false)
    {
      FileHot = false;
      labelFile.ForeColor = SystemColors.MenuText;
    }
    Invalidate();
    }
  
    private bool Sizing = false;
    private Point SizeOffset = Point.Empty;
    private void labelResize_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    Sizing = true;
    SizeOffset = new Point(this.Right - Cursor.Position.X, this.Bottom - Cursor.Position.Y);    
    }
  
    private void labelResize_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    if (Sizing)
    {
      //Clip cursor to dissallow sizing of form below 250x100
      Rectangle ClipRectangle = RectangleToScreen(new Rectangle(250, 100, Width, Height));
      ClipRectangle.Offset(SizeOffset);
      Cursor.Clip = ClipRectangle;
      this.Size = new Size(Cursor.Position.X + SizeOffset.X - Location.X, Cursor.Position.Y + SizeOffset.Y - Location.Y);
    }
    }
  
    private void labelResize_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
    {
    Sizing = false;
    Cursor.Clip = Rectangle.Empty;    
    }
  
    private void MainForm_Resize(object sender, System.EventArgs e)
    {
    this.Region=new Region(FormShape);
    }
    
  }
}
        
&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/7074608882490659850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/shaped-form-resizable-and-moveable.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/7074608882490659850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/7074608882490659850'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/shaped-form-resizable-and-moveable.html' title='Shaped Form Resizable and Moveable'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTGqf7809GsSVqT4jSekGgImmeNfzACCZJyvulYwV7Ps_OgROLz-AeeSv-7eXX5SUbepSIWYcPtP1fm5RIlrRTbdqPyy4L-jwlJ1Iilr8XQejBNI3uH1JRSLfTiUboKkAsfeETcdb5R10/s72-c/Shaped+Form+Resizable+and+Moveable.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-1965331004797374472</id><published>2011-07-29T10:24:00.000-07:00</published><updated>2011-07-29T10:24:57.974-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Adobe Premiere"/><category scheme="http://www.blogger.com/atom/ns#" term="Multimedia"/><title type='text'>Repair Encoding Error Adobe Media Encoder CS4</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&quot;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Could not read from the source&quot;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;When you will encode your premiere project squence with Adobe Media Encoder but you have failed?? and get some message like this:&lt;br /&gt;
&lt;div style=&quot;border: solid 1px white; padding: 3px;&quot;&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;-----------------------------------------------------------------------------&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Could not read from the source. Please check if it has moved or been deleted.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;-----------------------------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;Yes, I hate it..&lt;br /&gt;
You know what&#39;s wrong? what is the reason? this is the reason:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&quot;You removed an earlier version of Adobe Premiere Pro or Adobe Creative Suite on the same computer.&quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;IT CAN BE FIXED, AND YOU CAN RENDER YOU ADOBE PREMIERE PROJECT WITH YOUR ADOBE MEDIA ENCODER.&lt;/b&gt;&lt;br /&gt;
I Found 2 solution from the adobe.com site. read it (Its Works):&lt;br /&gt;
&lt;hr /&gt;&lt;b&gt;[x] Solution 1: Create a shortcut to the Premiere Pro executable file, rename the shortcut to Premiere, and move the shortcut to C:\Program Files\Common Files\Adobe\dynamiclink.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Close all Adobe applications.&lt;/li&gt;
&lt;li&gt;In Windows Explorer, navigate to C:\Program Files\Adobe\Adobe Premiere Pro CS4. (If you installed Premiere Pro CS4 in a location other than the default of C:\Program Files\Adobe, then navigate to your custom installation location.)&lt;/li&gt;
&lt;li&gt;Right-click on Adobe Premiere Pro.exe (which might appear without the .exe extension) and choose Create Shortcut.&lt;/li&gt;
&lt;li&gt;Rename the newly created shortcut to just Premiere.&lt;/li&gt;
&lt;/ul&gt;&lt;b style=&quot;color: red;&quot;&gt;[!]&lt;/b&gt; &lt;i&gt;Important: The name of the shortcut must be exactly Premiere with no other characters.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Open a second Windows Explorer window, and navigate to C:\Program Files\Common Files\Adobe\dynamiclink.&lt;/i&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Move the Premiere shortcut that you created into the dynamiclink folder.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;[x] Solution 2&lt;/b&gt;: &lt;b&gt;Remove and reinstall all Premiere Pro CS4 components or all Adobe Creative Suite 4 components&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Do one of the following:&lt;/li&gt;
&lt;/ul&gt;&lt;ol style=&quot;margin-left: 40px; text-align: left;&quot;&gt;&lt;li&gt;Windows XP: Choose Start &amp;gt; Control Panel &amp;gt; Add or Remove Programs.&lt;/li&gt;
&lt;li&gt;Windows Vista: Choose Start &amp;gt; Control Panel &amp;gt; Programs and Features.&lt;/li&gt;
&lt;/ol&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li&gt;In the list of installed programs, select Adobe Premiere Pro CS4, Adobe Creative Suite 4 Production Premium, or Adobe Creative Suite 4 Master Collection.&lt;/li&gt;
&lt;li&gt;Click Change/Remove (Windows XP) or Uninstall (Windows Vista).&lt;/li&gt;
&lt;li&gt;Follow the on-screen instructions to remove all components of Premiere Pro CS4 (including Adobe Encore CS4 and Adobe OnLocation CS4) or to remove all components of your edition of Adobe Creative Suite 4.&lt;/li&gt;
&lt;li&gt;Re-install your Adobe software.&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;text-align: right;&quot;&gt;&lt;i&gt;Based from: &lt;a href=&quot;http://kb2.adobe.com/cps/407/kb407106.html&quot;&gt;http://kb2.adobe.com/cps/407/kb407106.html&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/1965331004797374472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/repair-encoding-error-adobe-media.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1965331004797374472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1965331004797374472'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/repair-encoding-error-adobe-media.html' title='Repair Encoding Error Adobe Media Encoder CS4'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-8333082158849678465</id><published>2011-07-27T12:50:00.000-07:00</published><updated>2011-07-27T12:50:18.138-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom Control"/><category scheme="http://www.blogger.com/atom/ns#" term="Slider"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Create Slider Control With Custom Color</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYSKC1lOH7WKceIWR12s74m53viRGP2_ymcK7fPAT6CIKtuJIEGI61cXeYss-cj1TauEvA4yvXOgTYxOGKFSgCiw96pu1nJohUDCe8zZS6QPRzzwPR2fIBPOSTDdpqP6G0AfqvNtZkJew/s1600/customt+rackbar+controls+vb+net+csharp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYSKC1lOH7WKceIWR12s74m53viRGP2_ymcK7fPAT6CIKtuJIEGI61cXeYss-cj1TauEvA4yvXOgTYxOGKFSgCiw96pu1nJohUDCe8zZS6QPRzzwPR2fIBPOSTDdpqP6G0AfqvNtZkJew/s1600/customt+rackbar+controls+vb+net+csharp.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;All too often I see examples of custom controls which unnecessarily add child controls. For instance, a custom trackbar control may have a label or panel added to act as the scrolling thumb tab.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt; In this instance that&#39;s not so bad as it only creates one extra window handle, but where several such child controls are added the user will see what is percieved as flicker as each window is individually painted one after the other. No amount of doublebuffering will cure this.&lt;br /&gt;
&lt;br /&gt;
Since we need to respond to mouse, keyboard or code change events and then calculate the exact bounds of the child control, it really makes no sense to add the extra control. We may as well apply those bounds to a rectangle instead, and then paint within this rectangle (don&#39;t have to paint a Rectangle just need to paint inside it).&lt;br /&gt;
&lt;br /&gt;
The following example shows how to define and use a rectangle for this purpose. I have tried to make it behave just like a standard System.Windows.Forms.Trackbar control, but have made no offort to have it look like one. Hopefully, you&#39;ll be able to apply the same principles to other custom controls, perhaps using some of the many control renderers to simulate &quot;lite&quot; controls.&lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Imports System.ComponentModel
Namespace Dotnetrix.Samples.VB
  &amp;lt;DefaultEvent(&amp;quot;Scroll&amp;quot;), _
  DefaultProperty(&amp;quot;Value&amp;quot;), _
  ToolboxBitmap(GetType(System.Windows.Forms.TrackBar))&amp;gt; _
  Public Class TrackBar
    Inherits Control
    Public Sub New()
    MyBase.New()
    Me.SetStyle(ControlStyles.SupportsTransparentBackColor Or ControlStyles.OptimizedDoubleBuffer Or _
         ControlStyles.AllPaintingInWmPaint Or ControlStyles.Selectable Or ControlStyles.UserMouse, True)
    Me.Thumb = New Rectangle()
    Me.LayoutTrackBarParts()
    End Sub
    Protected Overrides ReadOnly Property DefaultSize() As System.Drawing.Size
    Get
      Return New Size(100, 60)
    End Get
    End Property
#Region &amp;quot; Event Delarations &amp;quot;
    Public Event Scroll As EventHandler
    Public Event ValueChanged As EventHandler
#End Region
#Region &amp;quot; Private Instance Variables &amp;quot;
    Private _orientation As Orientation = Orientation.Horizontal
    Private _minimum As Int32
    Private _maximum As Int32 = 10
    Private _smallChange As Int32 = 1
    Private _largeChange As Int32 = 5
    Private _value As Int32
    Private _tickStyle As TickStyle = TickStyle.BottomRight
    Private _tickFrequency As Int32 = 1
    Private _thumbDragging As Boolean
    Private _scrollUp As Boolean
    Private Thumb As Rectangle
    Private _thumbFocused As Boolean
    Private scrollTimer As Timer
#End Region
#Region &amp;quot; Public properties &amp;quot;
    &amp;lt;DefaultValue(GetType(Orientation), &amp;quot;Horizontal&amp;quot;)&amp;gt; _
    Public Property Orientation() As Orientation
    Get
      Return _orientation
    End Get
    Set(ByVal value As Orientation)
      If (_orientation &amp;lt;&amp;gt; value) Then
        _orientation = value
        Dim w, h As Int32
        w = Me.Height
        h = Me.Width
        Me.Size = New Size(w, h)
        Me.LayoutTrackBarParts()
        Me.Invalidate()
      End If
    End Set
    End Property
    &amp;lt;DefaultValue(0), _
    RefreshProperties(RefreshProperties.All)&amp;gt; _
    Public Property Minimum() As Int32
    Get
      Return _minimum
    End Get
    Set(ByVal value As Int32)
      If (_minimum &amp;lt;&amp;gt; value) Then
        _minimum = value
        If (_maximum &amp;lt;= value) Then
        _maximum = value
        End If
        Me.LayoutTrackBarParts()
        Me.Invalidate()
      End If
    End Set
    End Property
    &amp;lt;DefaultValue(10)&amp;gt; _
    Public Property Maximum() As Int32
    Get
      Return _maximum
    End Get
    Set(ByVal value As Int32)
      If (_maximum &amp;lt;&amp;gt; value) Then
        _maximum = value
        If (Minimum &amp;gt;= value) Then
        Minimum = value
        End If
        Me.LayoutTrackBarParts()
        Me.Invalidate()
      End If
    End Set
    End Property
    &amp;lt;DefaultValue(1)&amp;gt; _
    Public Property SmallChange() As Int32
    Get
      Return _smallChange
    End Get
    Set(ByVal value As Int32)
      _smallChange = value
    End Set
    End Property
    &amp;lt;DefaultValue(5)&amp;gt; _
    Public Property LargeChange() As Int32
    Get
      Return _largeChange
    End Get
    Set(ByVal value As Int32)
      _largeChange = value
    End Set
    End Property
    Public Property Value() As Int32
    Get
      If (_value &amp;lt; Me.Minimum) Then
        Return Me.Minimum
      End If
      Return _value
    End Get
    Set(ByVal value As Int32)
      If (value &amp;lt; Me.Minimum) Then
        value = _minimum
      End If
      If (value &amp;gt; _maximum) Then
        value = _maximum
      End If
      If (value &amp;lt;&amp;gt; _value) Then
        _value = value
        Me.LayoutTrackBarParts()
        Me.OnValueChanged(EventArgs.Empty)
      End If
    End Set
    End Property
    Private Function ShouldSerializeValue() As Boolean
    Return Me._value &amp;lt;&amp;gt; Me.Minimum
    End Function
    Private Sub ResetValue()
    Me._value = Me.Minimum
    End Sub
    &amp;lt;DefaultValue(False)&amp;gt; _
    Public Shadows Property TabStop() As Boolean
    Get
      Return MyBase.TabStop
    End Get
    Set(ByVal value As Boolean)
      MyBase.TabStop = value
    End Set
    End Property
    &amp;lt;DefaultValue(&amp;quot;&amp;quot;), _
    Browsable(False), _
    EditorBrowsable(EditorBrowsableState.Never)&amp;gt; _
    Public Overrides Property Text() As String
    Get
      Return String.Empty
    End Get
    Set(ByVal value As String)
      MyBase.Text = String.Empty
    End Set
    End Property
    &amp;lt;DefaultValue(GetType(TickStyle), &amp;quot;BottomRight&amp;quot;)&amp;gt; _
    Public Property TickStyle() As TickStyle
    Get
      Return _tickStyle
    End Get
    Set(ByVal value As TickStyle)
      If (_tickStyle &amp;lt;&amp;gt; value) Then
        _tickStyle = value
        Me.Invalidate()
      End If
    End Set
    End Property
    &amp;lt;DefaultValue(1)&amp;gt; _
    Public Property TickFrequency() As Int32
    Get
      Return _tickFrequency
    End Get
    Set(ByVal value As Int32)
      If (_tickFrequency &amp;lt;&amp;gt; value) Then
        _tickFrequency = value
        Me.Invalidate()
      End If
    End Set
    End Property
#End Region
#Region &amp;quot; private Properties &amp;quot;
    Private ReadOnly Property Horizontal() As Boolean
    Get
      Return _orientation = Orientation.Horizontal
    End Get
    End Property
    Private Property ThumbDragging() As Boolean
    Get
      Return _thumbDragging
    End Get
    Set(ByVal value As Boolean)
      If (_thumbDragging &amp;lt;&amp;gt; value) Then
        _thumbDragging = value
        Me.Invalidate()
      End If
    End Set
    End Property
#End Region
#Region &amp;quot; Overridden Methods &amp;quot;
    Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    &#39;Do default painting
    MyBase.OnPaint(e)
    &#39;Draw Tick Marks
    DrawTicks(e.Graphics)
    &#39;Draw Channel
    Dim channelBounds As Rectangle
    If Me.Horizontal Then
      channelBounds = New Rectangle(6, Me.Height / 2 - 2, Me.Width - 16, 4)
    Else
      channelBounds = New Rectangle(Me.Width / 2 - 2, 6, 4, Me.Height - 16)
    End If
    ControlPaint.DrawBorder3D(e.Graphics, channelBounds, Border3DStyle.Sunken)
    &#39; Draw the Thumb Object
    Using brush As SolidBrush = New SolidBrush(Color.Blue)
      If (_thumbFocused) Then
        brush.Color = Color.Green
      End If
      If (ThumbDragging) Then
        brush.Color = Color.Red
      End If
      e.Graphics.FillRectangle(brush, Me.Thumb)
    End Using
    &#39;Draw Focus
    If (Me.Focused AndAlso Me.ShowFocusCues) Then
      ControlPaint.DrawFocusRectangle(e.Graphics, Me.ClientRectangle)
    End If
    End Sub
    Protected Overrides Sub OnGotFocus(ByVal e As EventArgs)
    MyBase.OnGotFocus(e)
    _thumbFocused = (Me.Focused AndAlso Me.ShowFocusCues)
    Me.Invalidate()
    End Sub
    Protected Overrides Sub OnLostFocus(ByVal e As EventArgs)
    MyBase.OnLostFocus(e)
    _thumbFocused = (Me.Focused AndAlso Me.ShowFocusCues)
    Me.Invalidate()
    End Sub
    Protected Overrides Function IsInputKey(ByVal keyData As Keys) As Boolean
    Select Case (keyData)
      Case Keys.Up, Keys.Down, Keys.Left, Keys.Right
        Return True
      Case Else
        Return MyBase.IsInputKey(keyData)
    End Select
    End Function
    Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs)
    MyBase.OnKeyDown(e)
    Select Case (e.KeyCode)
      Case Keys.Up, Keys.Left
        If (Me.Horizontal) Then
        Me.Value -= _smallChange
        Else
        Me.Value += _smallChange
        End If
      Case Keys.Down, Keys.Right
        If (Me.Horizontal) Then
        Me.Value += _smallChange
        Else
        Me.Value -= _smallChange
        End If
      Case Keys.PageDown
        If (Me.Horizontal) Then
        Me.Value += _largeChange
        Else
        Me.Value -= _largeChange
        End If
      Case Keys.PageUp
        If (Me.Horizontal) Then
        Me.Value -= _largeChange
        Else
        Me.Value += _largeChange
        End If
      Case Keys.Home
        If (Me.Horizontal) Then
        Me.Value = _minimum
        Else
        Me.Value = _maximum
        End If
      Case Keys.End
        If (Me.Horizontal) Then
        Me.Value = _maximum
        Else
        Me.Value = _minimum
        End If
    End Select
    End Sub
    Protected Overrides Sub OnMouseWheel(ByVal e As MouseEventArgs)
    MyBase.OnMouseWheel(e)
    Me.Value += (e.Delta / WHEEL_DELTA) * WHEEL_LINES
    End Sub
    Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
    MyBase.OnMouseDown(e)
    If (e.Button = MouseButtons.Left) Then
      ThumbDragging = Thumb.Contains(e.Location)
      If (Not ThumbDragging) Then
        If (Me.Horizontal) Then
        _scrollUp = e.X &amp;gt; Thumb.Right
        Else
        _scrollUp = e.Y &amp;lt; Thumb.Top
        End If
        If (scrollTimer Is Nothing) Then
        InitTimer()
        End If
        scrollTimer.Start()
      End If
    End If
    End Sub
    Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
    MyBase.OnMouseUp(e)
    ThumbDragging = False
    If (Me.scrollTimer IsNot Nothing) Then
      Me.scrollTimer.Stop()
    End If
    End Sub
    Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
    MyBase.OnMouseMove(e)
    If (ThumbDragging) Then
      Me.Value = ValueFromPoint(e.Location)
    End If
    End Sub
    Protected Overrides Sub OnVisibleChanged(ByVal e As EventArgs)
    MyBase.OnVisibleChanged(e)
    If (Me.Visible) Then
      Me.LayoutTrackBarParts()
    End If
    End Sub
    Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
    MyBase.OnSizeChanged(e)
    Me.LayoutTrackBarParts()
    End Sub
#End Region
#Region &amp;quot; Protected Methods &amp;quot;
    Protected Overridable Sub OnScroll(ByVal e As EventArgs)
    RaiseEvent Scroll(Me, e)
    End Sub
    Protected Overridable Sub OnValueChanged(ByVal eventArgs As EventArgs)
    RaiseEvent ValueChanged(Me, eventArgs)
    Me.LayoutTrackBarParts()
    Me.OnScroll(eventArgs)
    Me.Invalidate()
    End Sub
#End Region
#Region &amp;quot; Internal Methods &amp;quot;
    Private Sub LayoutTrackBarParts()
    If Me.Horizontal Then
      Thumb.Size = New Size(14, 28)
    Else
      Thumb.Size = New Size(28, 14)
    End If
    Dim channelLength As Single
    If Me.Horizontal Then
      channelLength = Me.Width - 26 &#39; Channel Left margin + Channel Right margin + Thumb.Width
    Else
      channelLength = Me.Height - 26 &#39; Channel Top margin + Channel Bottom margin + Thumb.Height
    End If
    Dim stepCount As Single = (Me.Maximum - Me.Minimum)
    Dim stepSize As Single
    If stepCount &amp;gt; 0 Then
      stepSize = channelLength / stepCount
    Else
      stepSize = 0
    End If
    Dim thumbOffset As Single = (stepSize) * (Me.Value - Me.Minimum)
    If Me.Horizontal Then
      Thumb.Location = Point.Round(New PointF(6 + thumbOffset, Me.Height / 2 - 14))
    Else
      Thumb.Location = Point.Round(New PointF(Me.Width / 2 - 14, channelLength - thumbOffset + 6))
    End If
    End Sub
    Private Sub InitTimer()
    Me.scrollTimer = New Timer()
    Me.scrollTimer.Interval = 500
    AddHandler scrollTimer.Tick, AddressOf scrollTimer_Tick
    End Sub
    Private Sub scrollTimer_Tick(ByVal sender As Object, ByVal e As EventArgs)
    If (_scrollUp) Then
      Me.Value += Me.LargeChange
    Else
      Me.Value -= Me.LargeChange
    End If
    If (Me._value = Me.Minimum OrElse Me._value = Me.Maximum) Then
      Me.scrollTimer.Stop()
    End If
    Dim val As Int32 = Me.ValueFromPoint(Me.PointToClient(Cursor.Position))
    If (_scrollUp AndAlso Me._value &amp;gt; val) Then
      Me.scrollTimer.Stop()
    End If
    If (Not _scrollUp AndAlso Me._value &amp;lt; val) Then
      Me.scrollTimer.Stop()
    End If
    End Sub
    Private Function ValueFromPoint(ByVal point As Point) As Int32
    Dim channelLength As Single
    If (Me.Horizontal) Then
      channelLength = Me.Width - 26 &#39; Channel Left margin + Channel Right margin + Thumb.Width
    Else
      channelLength = Me.Height - 26 &#39; Channel Top margin + Channel Bottom margin + Thumb.Height
    End If
    Dim stepCount As Single = (Me.Maximum - Me.Minimum)
    Dim stepSize As Single = 0
    If (stepCount &amp;gt; 0) Then
      stepSize = channelLength / stepCount
    End If
    If (Me.Horizontal) Then
      point.Offset(-7, 0)
      Return (point.X / stepSize) + Me.Minimum
    End If
    point.Offset(0, -7)
    Return Me.Maximum - (point.Y / stepSize) + Me.Minimum
    End Function
    Private Sub DrawTicks(ByVal graphics As Graphics)
    If (TickStyle &amp;lt;&amp;gt; TickStyle.None) Then
      &#39;TODO: Implement Tick Drawing
    End If
    End Sub
#End Region
    Private WHEEL_DELTA As Int32 = SystemInformation.MouseWheelScrollDelta
    Private WHEEL_LINES As Int32 = SystemInformation.MouseWheelScrollLines
  End Class
End Namespace
        &lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
using System;
namespace Dotnetrix.Samples.CSharp
{
  [DefaultEvent(&amp;quot;Scroll&amp;quot;)]
  [DefaultProperty(&amp;quot;Value&amp;quot;)]
  [ToolboxBitmap(typeof(System.Windows.Forms.TrackBar))]
  public class TrackBar : Control
  {
    public TrackBar()
    : base()
    {
    this.SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.OptimizedDoubleBuffer |
          ControlStyles.AllPaintingInWmPaint | ControlStyles.Selectable | ControlStyles.UserMouse, true);
    this.Thumb = new Rectangle();
    this.LayoutTrackBarParts();
    }
    protected override Size DefaultSize
    {
    get
    {
      return new Size(100, 60);
    }
    }
    #region Event Delarations
    public event EventHandler Scroll;
    public event EventHandler ValueChanged;
    #endregion
    #region Private Instance Variables
    private Orientation orientation = Orientation.Horizontal;
    private int minimum = 0;
    private int maximum = 10;
    private int smallChange = 1;
    private int largeChange = 5;
    private int _value = 0;
    private TickStyle tickStyle = TickStyle.BottomRight;
    private int tickFrequency = 1;
    private bool thumbDragging = false;
    private bool scrollUp = false;
    private Rectangle Thumb;
    private bool ThumbFocused;
    private Timer scrollTimer;
    #endregion
    #region Public properties
    [DefaultValue(typeof(Orientation), &amp;quot;Horizontal&amp;quot;)]
    public Orientation Orientation
    {
    get { return this.orientation; }
    set
    {
      if (this.orientation != value)
      {
        this.orientation = value;
        int w, h;
        w = this.Height;
        h = this.Width;
        this.Size = new Size(w, h);
        this.LayoutTrackBarParts();
        this.Invalidate();
      }
    }
    }
    [DefaultValue(0)]
    [RefreshProperties(RefreshProperties.All)]
    public int Minimum
    {
    get { return minimum; }
    set
    {
      if (minimum != value)
      {
        minimum = value;
        if (maximum &amp;lt;= value)
        Maximum = value;
        this.LayoutTrackBarParts();
        this.Invalidate();
      }
    }
    }
    [DefaultValue(10)]
    public int Maximum
    {
    get { return maximum; }
    set
    {
      if (maximum != value)
      {
        maximum = value;
        if (minimum &amp;gt;= value)
        Minimum = value;
        this.LayoutTrackBarParts();
        this.Invalidate();
      }
    }
    }
    [DefaultValue(1)]
    public int SmallChange
    {
    get { return smallChange; }
    set
    {
      if (smallChange != value)        
        smallChange = value;
    }
    }
    [DefaultValue(5)]
    public int LargeChange
    {
    get { return largeChange; }
    set
    {
      if (largeChange != value)
        largeChange = value;
    }
    }
    public int Value
    {
    get
    {
      if (_value &amp;lt; this.minimum)
        return this.minimum;
      return _value;
    }
    set
    {
      if (value &amp;lt; this.minimum)
        value = this.minimum;
      if (value &amp;gt; this.maximum)
        value = this.maximum;
      if (value != _value)
      {
        _value = value;
        this.LayoutTrackBarParts();
        this.OnValueChanged(EventArgs.Empty);
      }
    }
    }
    private bool ShouldSerializeValue()
    {
    return this._value != this.minimum;
    }
    private void ResetValue()
    {
    this._value = this.minimum;
    }
    [DefaultValue(false)]
    public new bool TabStop
    {
    get { return base.TabStop; }
    set { base.TabStop = value; }
    }
    [DefaultValue(&amp;quot;&amp;quot;)]
    [Browsable(false)]
    [EditorBrowsable(EditorBrowsableState.Never)]
    public override string Text
    {
    get { return &amp;quot;&amp;quot;; }
    set { base.Text = &amp;quot;&amp;quot;; }
    }
    [DefaultValue(typeof(TickStyle), &amp;quot;BottomRight&amp;quot;)]
    public TickStyle TickStyle
    {
    get { return this.tickStyle; }
    set
    {
      if (this.tickStyle != value)
      {
        this.tickStyle = value;
        this.Invalidate();
      }
    }
    }
    [DefaultValue(1)]
    public int TickFrequency
    {
    get { return this.tickFrequency; }
    set
    {
      if (this.tickFrequency != value)
      {
        this.tickFrequency = value;
        this.Invalidate();
      }
    }
    }
    #endregion
    #region private Properties
    private bool Horizontal
    {
    get { return this.orientation == Orientation.Horizontal; }
    }
    private bool ThumbDragging
    {
    get { return thumbDragging; }
    set
    {
      if (thumbDragging != value)
      {
        thumbDragging = value;
        this.Invalidate();
      }
    }
    }
    #endregion
    #region Overridden Methods
    protected override void OnPaint(PaintEventArgs e)
    {
    //Do default painting
    base.OnPaint(e);
    //Draw Tick Marks
    DrawTicks(e.Graphics);
    //Draw Channel
    Rectangle channelBounds = this.Horizontal ?
      new Rectangle(6, this.Height / 2 - 2, this.Width - 16, 4) :
      new Rectangle(this.Width / 2 - 2, 6, 4, this.Height - 16);
    ControlPaint.DrawBorder3D(e.Graphics, channelBounds, Border3DStyle.Sunken);
    // Draw the Thumb Object
    using (SolidBrush brush = new SolidBrush(Color.Blue))
    {
      if (ThumbFocused)
        brush.Color = Color.Green;
      if (ThumbDragging)
        brush.Color = Color.Red;
      e.Graphics.FillRectangle(brush, this.Thumb);
    }
    //Draw Focus
    if (this.Focused &amp;amp;&amp;amp; this.ShowFocusCues)
      ControlPaint.DrawFocusRectangle(e.Graphics, this.ClientRectangle);
    }
    protected override void OnGotFocus(EventArgs e)
    {
    base.OnGotFocus(e);
    ThumbFocused = (this.Focused &amp;amp;&amp;amp; this.ShowFocusCues);
    this.Invalidate();
    }
    protected override void OnLostFocus(EventArgs e)
    {
    base.OnLostFocus(e);
    ThumbFocused = (this.Focused &amp;amp;&amp;amp; this.ShowFocusCues);
    this.Invalidate();
    }
    protected override bool IsInputKey(Keys keyData)
    {
    switch (keyData)
    {
      case Keys.Up:
      case Keys.Down:
      case Keys.Left:
      case Keys.Right:
        return true;
      default:
        return base.IsInputKey(keyData);
    }
    }
    protected override void OnKeyDown(KeyEventArgs e)
    {
    base.OnKeyDown(e);
    switch (e.KeyCode)
    {
      case Keys.Up:
      case Keys.Left:
        this.Value += this.Horizontal ? -this.smallChange : this.smallChange;
        break;
      case Keys.Down:
      case Keys.Right:
        this.Value += this.Horizontal ? this.smallChange : -this.smallChange;
        break;
      case Keys.PageDown:
        this.Value += this.Horizontal ? this.largeChange : -this.largeChange;
        break;
      case Keys.PageUp:
        this.Value += this.Horizontal ? -this.largeChange : this.largeChange;
        break;
      case Keys.Home:
        this.Value = this.Horizontal ? this.minimum : this.maximum;
        break;
      case Keys.End:
        this.Value = this.Horizontal ? this.maximum : this.minimum;
        break;
    }
    }
    protected override void OnMouseWheel(MouseEventArgs e)
    {
    base.OnMouseWheel(e);
    this.Value += (e.Delta / WHEEL_DELTA) * WHEEL_LINES;
    }
    protected override void OnMouseDown(MouseEventArgs e)
    {
    base.OnMouseDown(e);
    if (e.Button == MouseButtons.Left)
    {
      ThumbDragging = Thumb.Contains(e.Location);
      if (!ThumbDragging)
      {
        scrollUp = this.Horizontal ? e.X &amp;gt; Thumb.Right : e.Y &amp;lt; Thumb.Top;
        if (scrollTimer == null)
        InitTimer();
        scrollTimer.Start();
      }
    }
    }
    protected override void OnMouseUp(MouseEventArgs e)
    {
    base.OnMouseUp(e);
    ThumbDragging = false;
    if (this.scrollTimer != null)
      this.scrollTimer.Stop();
    }
    protected override void OnMouseMove(MouseEventArgs e)
    {
    base.OnMouseMove(e);
    if (ThumbDragging)
    {
      this.Value = ValueFromPoint(e.Location);
    }
    }
    protected override void OnVisibleChanged(EventArgs e)
    {
    base.OnVisibleChanged(e);
    if (this.Visible)
      this.LayoutTrackBarParts();
    }
    protected override void OnSizeChanged(EventArgs e)
    {
    base.OnSizeChanged(e);
    this.LayoutTrackBarParts();
    }
    #endregion
    #region Protected Methods
    protected virtual void OnScroll(EventArgs e)
    {
    if (this.Scroll != null)
      this.Scroll(this, e);
    }
    protected virtual void OnValueChanged(EventArgs eventArgs)
    {
    if (this.ValueChanged != null)
      this.ValueChanged(this, eventArgs);
    this.LayoutTrackBarParts();
    this.OnScroll(eventArgs);
    this.Invalidate();
    }
    #endregion
    #region Internal Methods
    private void LayoutTrackBarParts()
    {
    if (Thumb == null)
      return;
    Thumb.Size = this.Horizontal ?
      new Size(14, 28) :
      new Size(28, 14);
    float channelLength = this.Horizontal ?
      this.Width - 26 : // Channel Left margin + Channel Right margin + Thumb.Width
      this.Height - 26; // Channel Top margin + Channel Bottom margin + Thumb.Height
    float stepCount = (this.Maximum - this.Minimum);
    float stepSize = stepCount &amp;gt; 0 ? channelLength / stepCount : 0;
    float thumbOffset = (stepSize) * (this.Value - this.minimum);
    Thumb.Location = this.Horizontal ?
      Point.Round(new PointF(6 + thumbOffset, this.Height / 2 - 14)) :
      Point.Round(new PointF(this.Width / 2 - 14, channelLength - thumbOffset + 6));
    }
    private void InitTimer()
    {
    this.scrollTimer = new Timer();
    this.scrollTimer.Interval = 500;
    this.scrollTimer.Tick += new EventHandler(scrollTimer_Tick);
    }
    private void scrollTimer_Tick(object sender, EventArgs e)
    {
    this.Value += this.scrollUp ? this.largeChange : -this.largeChange;
    if (this._value == this.minimum || this._value == this.maximum)
      this.scrollTimer.Stop();
    int val = this.ValueFromPoint(this.PointToClient(Cursor.Position));
    if (this.scrollUp &amp;amp;&amp;amp; this._value &amp;gt; val)
      this.scrollTimer.Stop();
    if (!this.scrollUp &amp;amp;&amp;amp; this._value &amp;lt; val)
      this.scrollTimer.Stop();
    }
    private int ValueFromPoint(Point point)
    {
    float channelLength = this.Horizontal ?
      this.Width - 26 : // Channel Left margin + Channel Right margin + Thumb.Width
      this.Height - 26; // Channel Top margin + Channel Bottom margin + Thumb.Height
    float stepCount = (this.maximum - this.minimum);
    float stepSize = stepCount &amp;gt; 0 ? channelLength / stepCount : 0;
    if (this.Horizontal)
    {
      point.Offset(-7, 0);
      return (int)(point.X / stepSize) + this.minimum;
    }
    point.Offset(0, -7);
    return this.maximum - (int)(point.Y / stepSize) + this.minimum;
    }
    private void DrawTicks(Graphics graphics)
    {
    if (tickStyle == TickStyle.None)
      return;
    //TODO: Implement Tick Drawing
    }

    #endregion
    private int WHEEL_DELTA = SystemInformation.MouseWheelScrollDelta;
    private int WHEEL_LINES = SystemInformation.MouseWheelScrollLines;
  }
}
        &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/8333082158849678465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/create-slider-control-with-custom-color.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/8333082158849678465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/8333082158849678465'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/create-slider-control-with-custom-color.html' title='Create Slider Control With Custom Color'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYSKC1lOH7WKceIWR12s74m53viRGP2_ymcK7fPAT6CIKtuJIEGI61cXeYss-cj1TauEvA4yvXOgTYxOGKFSgCiw96pu1nJohUDCe8zZS6QPRzzwPR2fIBPOSTDdpqP6G0AfqvNtZkJew/s72-c/customt+rackbar+controls+vb+net+csharp.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-4701409112706768203</id><published>2011-07-27T12:44:00.000-07:00</published><updated>2011-07-27T12:51:09.212-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom Control"/><category scheme="http://www.blogger.com/atom/ns#" term="Panel"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Create a Circle Rounded Panel Controls</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNjbCHCRKocvljWCVZd3KmOydlLQCn__cwLqHDanGrLHPgLm-Hlft_qD26VB8lhj6IWUK-4hxFcXW8lq2a9bKFzdIqp37xprF35yzQuuJlWJWKIJF8Du8hj_qwcevqT4R7MZx2M1GF3U/s1600/rounded+panel+Form+Controls+VB+net+CSharp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;rounded panel Form Controls VB net CSharp&quot; border=&quot;0&quot; height=&quot;127&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNjbCHCRKocvljWCVZd3KmOydlLQCn__cwLqHDanGrLHPgLm-Hlft_qD26VB8lhj6IWUK-4hxFcXW8lq2a9bKFzdIqp37xprF35yzQuuJlWJWKIJF8Du8hj_qwcevqT4R7MZx2M1GF3U/s400/rounded+panel+Form+Controls+VB+net+CSharp.png&quot; title=&quot;rounded panel Form Controls VB net CSharp&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;When we Draw to a Graphics object we can set AntiAlias so as to make the edges of complex shapes look smooth. This is done by altering the color of some of the pixels on and around the edge so that the jagged edges appear smooth.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;When we create a region from a complex shape though, the recoloured pixels outside of the region are lost and as there is no way to trim the edges of the pixels (they are always square) our regions appear jagged. A simple solution to this is to put a pseudo transparent 1 pixel border around the control when shaping it. I doubt very much that you will notice this border, but it will greatly improve the appearance of the edges of your shaped control.&lt;br /&gt;
Because the Control in this example has rounded edges, it is not suitable for the AutoScrol property as the ScrollBars will be Clipped. For this reason the Control Inherits from Control and because we want to use it as a Container we have assigned the ParentControlDesigner to the Class.&lt;/div&gt;&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Namespace Dotnetrix.Samples.VB
  &amp;lt;System.ComponentModel.Designer(GetType(System.Windows.Forms.Design.ParentControlDesigner))&amp;gt; _
  Public Class RoundedPanel
  Inherits System.Windows.Forms.UserControl
#Region &quot; Windows Form Designer generated code &quot;
  Public Sub New()
  MyBase.New()
  &#39;This call is required by the Windows Form Designer.
  InitializeComponent()
  &#39;Add any initialization after the InitializeComponent() call
  Me.SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.DoubleBuffer Or ControlStyles.UserPaint, True)
  End Sub
  &#39;UserControl overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  If disposing Then
  If Not (components Is Nothing) Then
    components.Dispose()
  End If
  End If
  MyBase.Dispose(disposing)
  End Sub
  &#39;Required by the Windows Form Designer
  Private components As System.ComponentModel.IContainer
  &#39;NOTE: The following procedure is required by the Windows Form Designer
  &#39;It can be modified using the Windows Form Designer.  
  &#39;Do not modify it using the code editor.
  &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()
  components = New System.ComponentModel.Container
  End Sub
#End Region
  Private m_BorderRadius As Int32 = 32
  Public Property BorderRadius() As Int32
  Get
  Return m_BorderRadius
  End Get
  Set(ByVal Value As Int32)
  m_BorderRadius = Value
  Me.Invalidate()
  End Set
  End Property
  Protected Overrides ReadOnly Property DefaultSize() As System.Drawing.Size
  Get
  Return New Size(200, 100)
  End Get
  End Property
  Protected Overrides Sub OnMove(ByVal e As System.EventArgs)
  MyBase.OnMove(e)
  Me.Invalidate()
  End Sub
  Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
  MyBase.OnResize(e)
  Me.Invalidate()
  End Sub
  Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
  &#39;Draw the Parent onto our Control to give pseudo transparency.
  &#39;The BeginContainer and EndContainer calls stop incorrect painting of 
  &#39;child controls when both container and child have BackColor set to Transparent.
  &#39;This only happens as a result of the TranslateTransform() call.
  Dim g As System.Drawing.Drawing2D.GraphicsContainer = pevent.Graphics.BeginContainer()
  Dim translateRect As Rectangle = Me.Bounds
  pevent.Graphics.TranslateTransform(-Me.Left, -Me.Top)
  Dim pe As PaintEventArgs = New PaintEventArgs(pevent.Graphics, translateRect)
  Me.InvokePaintBackground(Me.Parent, pe)
  Me.InvokePaint(Me.Parent, pe)
  pevent.Graphics.ResetTransform()
  pevent.Graphics.EndContainer(g)
  &#39;Define the custom Border Region, Brush and Pen.
  Dim border As System.Drawing.Drawing2D.GraphicsPath
  Dim paintBrush As New SolidBrush(Me.BackColor)
  Dim borderPen As New Pen(Me.ForeColor)
  Dim r As Rectangle = Me.ClientRectangle
  &#39;Set the Region of the Control
  Me.Region = New Region(RoundRegion(r))
  r.Inflate(-1, -1)
  border = RoundRegion(r)
  &#39;Fill The Region with the Controls BackColor
  pevent.Graphics.FillPath(paintBrush, border)
  &#39;Paint any BackgroundImage that might have been set
  If Not (Me.BackgroundImage Is Nothing) Then
  Dim br As Brush = New TextureBrush(Me.BackgroundImage)
  pevent.Graphics.FillPath(br, border)
  br.Dispose()
  End If
  &#39;Draw the Region
  pevent.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
  pevent.Graphics.DrawPath(borderPen, border)
  &#39;Clean Up
  borderPen.Dispose()
  paintBrush.Dispose()
  border.Dispose()
  End Sub
  Private Function RoundRegion(ByVal r As Rectangle) As System.Drawing.Drawing2D.GraphicsPath
  &#39;Scale the radius if it&#39;s too large to fit.
  Dim radius As Int32 = m_BorderRadius
  If (radius &amp;gt; (r.Width)) Then radius = r.Width
  If (radius &amp;gt; (r.Height)) Then radius = r.Height
  Dim path As New System.Drawing.Drawing2D.GraphicsPath
  If radius &amp;lt;= 0 Then
  path.AddRectangle(r)
  Else
  path.AddArc(r.Left, r.Top, radius, radius, 180, 90)
  path.AddArc(r.Right - radius, r.Top, radius, radius, 270, 90)
  path.AddArc(r.Right - radius, r.Bottom - radius, radius, radius, 0, 90)
  path.AddArc(r.Left, r.Bottom - radius, radius, radius, 90, 90)
  path.CloseFigure()
  End If
  Return path
  End Function
  End Class
End Namespace
    &lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace Dotnetrix.Samples.CSharp
{
  /// &amp;lt;summary&amp;gt;
  /// Summary description for RoundedPanel.
  /// &amp;lt;/summary&amp;gt;
  [System.ComponentModel.Designer(typeof(System.Windows.Forms.Design.ParentControlDesigner))]
  public class RoundedPanel : System.Windows.Forms.Control
  {
  /// &amp;lt;summary&amp;gt; 
  /// Required designer variable.
  /// &amp;lt;/summary&amp;gt;
  private System.ComponentModel.Container components = null;
  public RoundedPanel()
  {
  // This call is required by the Windows.Forms Form Designer.
  InitializeComponent();
  // TODO: Add any initialization after the InitializeComponent call
  this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);
  }
  /// &amp;lt;summary&amp;gt; 
  /// Clean up any resources being used.
  /// &amp;lt;/summary&amp;gt;
  protected override void Dispose( bool disposing )
  {
  if( disposing )
  {
  if(components != null)
  {
    components.Dispose();
  }
  }
  base.Dispose( disposing );
  }
  #region Component Designer generated code
  /// &amp;lt;summary&amp;gt; 
  /// Required method for Designer support - do not modify 
  /// the contents of this method with the code editor.
  /// &amp;lt;/summary&amp;gt;
  private void InitializeComponent()
  {
  components = new System.ComponentModel.Container();
  }
  #endregion
  private int borderRadius = 32;
  public int BorderRadius
  {
  get{return borderRadius;}
  set
  {
  borderRadius = value;
  this.Invalidate();
  }
  }
  protected override Size DefaultSize
  {
  get{return new Size(200,100);}
  }
  protected override void OnMove(EventArgs e)
  {
  base.OnMove (e);
  this.Invalidate();
  }
  protected override void OnResize(EventArgs e)
  {
  base.OnResize (e);
  this.Invalidate();
  }
  protected override void OnPaintBackground(PaintEventArgs pevent)
  {
  //Draw the Parent onto our Control to give pseudo transparency.
  //The BeginContainer and EndContainer calls stop incorrect painting of 
  //child controls when both container and child have BackColor set to Transparent.
  //This only happens as a result of the TranslateTransform() call.
  System.Drawing.Drawing2D.GraphicsContainer g = pevent.Graphics.BeginContainer();
  Rectangle translateRect = this.Bounds;
  pevent.Graphics.TranslateTransform(-this.Left,-this.Top);
  PaintEventArgs pe = new PaintEventArgs(pevent.Graphics,translateRect);
  this.InvokePaintBackground(this.Parent,pe);
  this.InvokePaint(this.Parent,pe);
  pevent.Graphics.ResetTransform();
  pevent.Graphics.EndContainer(g);
  //Define the custom Border Region, Brush and Pen.
  System.Drawing.Drawing2D.GraphicsPath border;
  Brush paintBrush = new SolidBrush(this.BackColor);
  Pen borderPen = new Pen(this.ForeColor);
  Rectangle r = this.ClientRectangle;
  //Set the Region of the Control
  this.Region = new Region(RoundRegion(r));
  r.Inflate(-1,-1);
  border = RoundRegion(r);
  //Fill The Region with the Controls BackColor
  pevent.Graphics.FillPath(paintBrush,border);
  //Paint any BackgroundImage that might have been set
  if (this.BackgroundImage != null)
  {
  Brush br = new TextureBrush(this.BackgroundImage);
  pevent.Graphics.FillPath(br,border);
  br.Dispose();
  }
  //Draw the Region
  pevent.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
  pevent.Graphics.DrawPath(borderPen,border);
  //Clean Up
  borderPen.Dispose();
  paintBrush.Dispose();
  border.Dispose();
  }
  private System.Drawing.Drawing2D.GraphicsPath RoundRegion(Rectangle r)
  {
  //Scale the radius if it&#39;s too large to fit.
  int radius = borderRadius;
  if (radius &amp;gt; (r.Width))
  radius = r.Width;
  if (radius &amp;gt; (r.Height))
  radius = r.Height;
  System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
  if (radius &amp;lt;= 0)
  {
  path.AddRectangle(r);
  }
  else
  {
  path.AddArc(r.Left,r.Top,radius,radius,180,90);
  path.AddArc(r.Right - radius,r.Top,radius,radius,270,90);
  path.AddArc(r.Right-radius,r.Bottom-radius,radius,radius,0,90);
  path.AddArc(r.Left,r.Bottom-radius,radius,radius,90,90);
  path.CloseFigure();
  }
  return path;
  }
  }
}
    &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/4701409112706768203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/create-circle-rounded-panel-controls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/4701409112706768203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/4701409112706768203'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/create-circle-rounded-panel-controls.html' title='Create a Circle Rounded Panel Controls'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNjbCHCRKocvljWCVZd3KmOydlLQCn__cwLqHDanGrLHPgLm-Hlft_qD26VB8lhj6IWUK-4hxFcXW8lq2a9bKFzdIqp37xprF35yzQuuJlWJWKIJF8Du8hj_qwcevqT4R7MZx2M1GF3U/s72-c/rounded+panel+Form+Controls+VB+net+CSharp.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-4819717684743228451</id><published>2011-07-25T06:32:00.000-07:00</published><updated>2011-07-25T06:32:45.905-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ComboBox"/><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Create Combobox With Icon</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnguR5ZjrMH8-Kxl2cLVtpAIda6m6TugGc3fMwycyJxJbnmSOKeBkbIo3yzUWBjhJ0QwyDStOpYeqAY0P_bOyDLyhc6HIDtB4Ufl1_wAoLUS8OyhzyIlAVbdQ87flm5cEjMaDCO69BzaI/s1600/Create+ComboBox+With+Icon+Enabled+in+VB+net+Csharp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Create Combobox With Icon&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnguR5ZjrMH8-Kxl2cLVtpAIda6m6TugGc3fMwycyJxJbnmSOKeBkbIo3yzUWBjhJ0QwyDStOpYeqAY0P_bOyDLyhc6HIDtB4Ufl1_wAoLUS8OyhzyIlAVbdQ87flm5cEjMaDCO69BzaI/s1600/Create+ComboBox+With+Icon+Enabled+in+VB+net+Csharp.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;The following class modifies the Item collection to return a collection of Custom items. The Property Browser uses the Collection Editor rather than the StringCollection Editor. The DrawMode property has been hidden, since this property should not be changed.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Imports System.ComponentModel
Imports System.Drawing.Design
Imports System.ComponentModel.Design

Namespace Dotnetrix_Samples

  Public Class ImageCombo
  Inherits System.Windows.Forms.ComboBox

#Region &quot; Windows Form Designer generated code &quot;

  Public Sub New()
  MyBase.New()

  &#39;This call is required by the Windows Form Designer.
  InitializeComponent()

  &#39;Add any initialization after the InitializeComponent() call
  MyBase.DrawMode = DrawMode.OwnerDrawFixed

  End Sub

  &#39;UserControl overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
  If disposing Then
  If Not (components Is Nothing) Then
    components.Dispose()
  End If
  If Not (Me.Items Is Nothing) Then
    For Each o As Object In Me.Items
    If TypeOf o Is ImageComboItem Then
    DirectCast(o, ImageComboItem).Dispose()
    End If
    Next
  End If
  End If
  MyBase.Dispose(disposing)
  End Sub

  &#39;Required by the Windows Form Designer
  Private components As System.ComponentModel.IContainer

  &#39;NOTE: The following procedure is required by the Windows Form Designer
  &#39;It can be modified using the Windows Form Designer.  
  &#39;Do not modify it using the code editor.
  &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()
  components = New System.ComponentModel.Container
  End Sub

#End Region

  Private currentIndex As Int32 = -1

  &amp;lt;Browsable(False), EditorBrowsable(EditorBrowsableState.Never)&amp;gt; _
  Public Shadows ReadOnly Property DrawMode() As DrawMode
  Get
  Return DrawMode.OwnerDrawFixed
  End Get
  End Property

  &amp;lt;Editor(GetType(ImageComboItemEditor), GetType(UITypeEditor)), _
  DesignerSerializationVisibility(DesignerSerializationVisibility.Content)&amp;gt; _
  Public Shadows ReadOnly Property Items() As ObjectCollection
  Get
  Return MyBase.Items
  End Get
  End Property

  Private Class ImageComboItemEditor
  Inherits CollectionEditor

  Public Sub New(ByVal type As Type)
  MyBase.New(type)
  End Sub

  Protected Overrides Function CreateCollectionItemType() As System.Type
  Return GetType(ImageComboItem)
  End Function

  End Class

  Protected Overrides Sub OnDrawItem(ByVal e As System.Windows.Forms.DrawItemEventArgs)

  If e.Index = -1 OrElse e.Index &amp;gt; Me.Items.Count - 1 Then Return

  e.DrawBackground()

  Dim imageRect As Rectangle = New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Height, e.Bounds.Height)
  Dim textRectF As RectangleF = RectangleF.FromLTRB(imageRect.Right + 2, e.Bounds.Top, e.Bounds.Right, e.Bounds.Bottom)

  If TypeOf Items(e.Index) Is ImageComboItem Then

  Dim Item As ImageComboItem = DirectCast(Items(e.Index), ImageComboItem)

  If Not (Item.Image Is Nothing) Then
    e.Graphics.DrawImage(Item.Image, imageRect)
  End If
  End If

  Dim TextBrush As New SolidBrush(Me.ForeColor)
  If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then
  TextBrush.Color = SystemColors.HighlightText
  End If

  Dim sf As New StringFormat(StringFormatFlags.NoWrap)
  sf.LineAlignment = StringAlignment.Center
  sf.Trimming = StringTrimming.EllipsisCharacter

  e.Graphics.DrawString(Items(e.Index).ToString, Me.Font, TextBrush, textRectF, sf)
  TextBrush.Dispose()

  End Sub

  Protected Overrides Sub OnSelectedIndexChanged(ByVal e As System.EventArgs)
  If Me.SelectedIndex &amp;lt;&amp;gt; currentIndex Then
  currentIndex = Me.SelectedIndex
  MyBase.RefreshItem(Me.SelectedIndex)
  Else
  MyBase.OnSelectedIndexChanged(e)
  End If
  End Sub

  End Class

  &amp;lt;DesignTimeVisible(False)&amp;gt; _
  Public Class ImageComboItem
  Inherits Component

  Private m_object As Object
  Private m_Image As Image

  &amp;lt;TypeConverter(GetType(StringConverter))&amp;gt; _
  Public Property [Item]() As Object
  Get
  Return m_object
  End Get
  Set(ByVal Value As Object)
  m_object = Value
  End Set
  End Property

  Public Property [Image]() As Image
  Get
  Return m_Image
  End Get
  Set(ByVal Value As Image)
  m_Image = Value
  End Set
  End Property

  Public Overrides Function ToString() As String
  If m_object Is Nothing Then
  Return String.Empty
  Else
  Return m_object.ToString
  End If
  End Function

  End Class

End Namespace
    &lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

using System.Drawing.Design;
using System.ComponentModel.Design;

namespace Dotnetrix_Samples
{
  /// &amp;lt;summary&amp;gt;
  /// Summary description for ImageCombo.
  /// &amp;lt;/summary&amp;gt;
  public class ImageCombo : System.Windows.Forms.ComboBox
  {
  /// &amp;lt;summary&amp;gt; 
  /// Required designer variable.
  /// &amp;lt;/summary&amp;gt;
  private System.ComponentModel.Container components = null;

  public ImageCombo()
  {
  // This call is required by the Windows.Forms Form Designer.
  InitializeComponent();

  // TODO: Add any initialization after the InitializeComponent call
  base.DrawMode = DrawMode.OwnerDrawVariable;

  }

  /// &amp;lt;summary&amp;gt; 
  /// Clean up any resources being used.
  /// &amp;lt;/summary&amp;gt;
  protected override void Dispose( bool disposing )
  {
  if( disposing )
  {
  if(components != null)
  {
    components.Dispose();
  }
  if (this.Items != null)
  {
    foreach (Object o in this.Items)
    {
    if (o is ImageComboItem)
    ((ImageComboItem)o).Dispose();
    }
  }
  }
  base.Dispose( disposing );
  }

  #region Component Designer generated code
  /// &amp;lt;summary&amp;gt; 
  /// Required method for Designer support - do not modify 
  /// the contents of this method with the code editor.
  /// &amp;lt;/summary&amp;gt;
  private void InitializeComponent()
  {
  components = new System.ComponentModel.Container();
  }
  #endregion

  private int currentIndex = -1;

  [Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
  public new DrawMode DrawMode
  {
  get{return DrawMode.OwnerDrawFixed;}
  }


  [Editor(typeof(ImageComboItemEditor), typeof(UITypeEditor))]
  [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
  public new ObjectCollection Items
  {
  get{return base.Items;}
  }


  private class ImageComboItemEditor : CollectionEditor
  {
  public ImageComboItemEditor(Type type):base(type){}

  protected override Type CreateCollectionItemType()
  {
  return typeof(ImageComboItem);
  }


  }


  protected override void OnDrawItem(DrawItemEventArgs e)
  {
  if (e.Index == -1 || e.Index &amp;gt; this.Items.Count - 1)
  return;

  e.DrawBackground();

  Rectangle imageRect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Height, e.Bounds.Height);
  RectangleF textRectF = RectangleF.FromLTRB(imageRect.Right + 2, e.Bounds.Top, e.Bounds.Right, e.Bounds.Bottom);
  
  if (Items[e.Index] is ImageComboItem )
  {
  ImageComboItem Item = (ImageComboItem)Items[e.Index];
  
  if (Item.Image != null)
    e.Graphics.DrawImage(Item.Image, imageRect);
  }

  SolidBrush TextBrush = new SolidBrush(this.ForeColor);
  if ((e.State &amp;amp; DrawItemState.Selected) == DrawItemState.Selected)
  TextBrush.Color = SystemColors.HighlightText;

  StringFormat sf = new StringFormat(StringFormatFlags.NoWrap);
  sf.LineAlignment = StringAlignment.Center;
  sf.Trimming = StringTrimming.EllipsisCharacter;

  e.Graphics.DrawString(Items[e.Index].ToString(), this.Font, TextBrush, textRectF, sf);
  TextBrush.Dispose();
  }

  protected override void OnSelectedIndexChanged(EventArgs e)
  {
  if (this.SelectedIndex != this.currentIndex)
  {
  this.currentIndex = this.SelectedIndex;
  base.RefreshItem(this.SelectedIndex);
  }
  else
  {
  base.OnSelectedIndexChanged (e);
  }

  }

  }

  [DesignTimeVisible(false)]
  public class ImageComboItem : Component
  {

  private Object m_object;
  private Image m_Image;

  [TypeConverter(typeof(StringConverter))]
  public Object Item
  {
  get{return m_object;}
  set{m_object = value;}
  }

  public Image Image
  {
  get{return m_Image;}
  set{m_Image = value;}
  }

  public override string ToString()
  {
  if (m_object == null)
  return String.Empty;
  else
  return m_object.ToString();
  }


  }

}
    &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/4819717684743228451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/create-combobox-with-icon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/4819717684743228451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/4819717684743228451'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/create-combobox-with-icon.html' title='Create Combobox With Icon'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnguR5ZjrMH8-Kxl2cLVtpAIda6m6TugGc3fMwycyJxJbnmSOKeBkbIo3yzUWBjhJ0QwyDStOpYeqAY0P_bOyDLyhc6HIDtB4Ufl1_wAoLUS8OyhzyIlAVbdQ87flm5cEjMaDCO69BzaI/s72-c/Create+ComboBox+With+Icon+Enabled+in+VB+net+Csharp.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-1723495820479380511</id><published>2011-07-25T06:23:00.000-07:00</published><updated>2011-07-25T14:44:33.994-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Button"/><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Create Custom Button in Form</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9VvHdYxwguHGu3fyHW_W7WpDNztXzjY-mdfueE0ZDSQ7yZJ6FIv0bvdyT3csnZxxMulrjcJ-Zr6VB59KXpnXHINzl9DqqzQTr-Te2Vmsso5uR2YIsgt8JW4ElSrZk_HVZerJxx9OzVNc/s1600/Create+Custom+Button+in+Form+VB+net+Csharp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Create Custom Button in Form VB net Csharp&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9VvHdYxwguHGu3fyHW_W7WpDNztXzjY-mdfueE0ZDSQ7yZJ6FIv0bvdyT3csnZxxMulrjcJ-Zr6VB59KXpnXHINzl9DqqzQTr-Te2Vmsso5uR2YIsgt8JW4ElSrZk_HVZerJxx9OzVNc/s1600/Create+Custom+Button+in+Form+VB+net+Csharp.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;No need to Inherit from Button if you want a button with a completely  custom appearance.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt; The following class defines a Custom Button which can be set as a forms  AcceptButton or CancelButton, but which is inherited from Control rather  than Button. It also includes a custom TypeEditor to allow selection of  corners to be rounded.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;:&lt;i&gt; that this example needs a reference to System.Design.dll since it uses a custom TypeEditor &lt;/i&gt;&lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Imports System.ComponentModel
  Imports System.Security.Permissions
  Imports System.Drawing.Design
  Imports System.Windows.Forms.Design

  Namespace Dotnetrix.Samples.VB

  &amp;lt;Flags()&amp;gt; _
  Public Enum Corners
  None = 0
  TopLeft = 1
  TopRight = 2
  BottomLeft = 4
  BottomRight = 8
  All = TopLeft Or TopRight Or BottomLeft Or BottomRight
  End Enum

  Public Enum CustomButtonState
  [Normal] = 1
  [Hot]
  [Pressed]
  [Disabled]
  [Focused]
  End Enum

  Public Class CustomButton
  Inherits Control
  Implements IButtonControl

  Public Sub New()
  MyBase.New()
  Me.SetStyle(ControlStyles.Selectable Or ControlStyles.StandardClick Or ControlStyles.ResizeRedraw Or ControlStyles.AllPaintingInWmPaint Or ControlStyles.DoubleBuffer Or ControlStyles.UserPaint Or ControlStyles.SupportsTransparentBackColor, True)
  End Sub

  #Region &quot; Private Instance Variables &quot;

  Private m_DialogResult As DialogResult
  Private m_IsDefault As Boolean

  Private m_CornerRadius As Int32 = 8
  Private m_RoundCorners As Corners
  Private m_ButtonState As CustomButtonState = CustomButtonState.Normal

  Private m_ImageAlign As ContentAlignment = ContentAlignment.MiddleCenter
  Private m_TextAlign As ContentAlignment = ContentAlignment.MiddleCenter
  Private m_ImageList As ImageList
  Private m_ImageIndex As Int32 = -1

  Private keyPressed As Boolean
  Private contentRect As Rectangle

  #End Region

  #Region &quot; IButtonControl Implementation &quot;

  &amp;lt;Category(&quot;Behavior&quot;), DefaultValue(GetType(DialogResult), &quot;None&quot;), _
  Description(&quot;The dialog result produced in a modal form by clicking the button.&quot;)&amp;gt; _
  Public Property DialogResult() As System.Windows.Forms.DialogResult Implements System.Windows.Forms.IButtonControl.DialogResult
  Get
    Return m_DialogResult
  End Get
  Set(ByVal Value As System.Windows.Forms.DialogResult)
    If [Enum].IsDefined(GetType(DialogResult), Value) Then
    m_DialogResult = Value
    End If
  End Set
  End Property

  Public Sub NotifyDefault(ByVal value As Boolean) Implements System.Windows.Forms.IButtonControl.NotifyDefault
  If m_IsDefault &amp;lt;&amp;gt; value Then
    m_IsDefault = value
  End If
  Me.Invalidate()
  End Sub

  Public Sub PerformClick() Implements System.Windows.Forms.IButtonControl.PerformClick
  If Me.CanSelect Then
    MyBase.OnClick(EventArgs.Empty)
  End If
  End Sub

  #End Region

  #Region &quot; Properties &quot;

  &#39;ButtonState
  &amp;lt;Browsable(False)&amp;gt; _
  Public ReadOnly Property ButtonState() As CustomButtonState
  Get
    Return m_ButtonState
  End Get
  End Property

  &#39;CornerRadius
  &amp;lt;Category(&quot;Appearance&quot;), _
  DefaultValue(8), _
  Description(&quot;Defines the radius of the controls RoundedCorners.&quot;)&amp;gt; _
  Public Property CornerRadius() As Int32
  Get
    Return m_CornerRadius
  End Get
  Set(ByVal Value As Int32)
    If m_CornerRadius = Value Then Return
    m_CornerRadius = Value
    Me.Invalidate()
  End Set
  End Property

  &#39;DefaultSize
  Protected Overrides ReadOnly Property DefaultSize() As System.Drawing.Size
  Get
    Return New Size(75, 23)
  End Get
  End Property

  &#39;IsDefault
  &amp;lt;Browsable(False)&amp;gt; _
  Public ReadOnly Property IsDefault() As Boolean
  Get
    Return m_IsDefault
  End Get
  End Property

  &#39;ImageList
  &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(GetType(ImageList), Nothing), _
  Description(&quot;The image list to get the image to display in the face of the control.&quot;)&amp;gt; _
  Public Property ImageList() As ImageList
  Get
    Return m_ImageList
  End Get
  Set(ByVal Value As ImageList)
    m_ImageList = Value
    Me.Invalidate()
  End Set
  End Property

  &#39;ImageIndex
  &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(-1), _
  Description(&quot;The index of the image in the image list to display in the face of the control.&quot;), _
  TypeConverter(GetType(ImageIndexConverter)), _
  Editor(&quot;System.Windows.Forms.Design.ImageIndexEditor, System.Design&quot;, GetType(System.Drawing.Design.UITypeEditor))&amp;gt; _
  Public Property ImageIndex() As Int32
  Get
    Return m_ImageIndex
  End Get
  Set(ByVal Value As Int32)
    m_ImageIndex = Value
    Me.Invalidate()
  End Set
  End Property

  &#39;ImageAlign
  &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(GetType(ContentAlignment), &quot;MiddleCenter&quot;), _
  Description(&quot;The alignment of the image that will be displayed in the face of the control.&quot;)&amp;gt; _
  Public Property ImageAlign() As ContentAlignment
  Get
    Return m_ImageAlign
  End Get
  Set(ByVal Value As ContentAlignment)
    If Not [Enum].IsDefined(GetType(ContentAlignment), Value) Then
    Throw New InvalidEnumArgumentException(&quot;value&quot;, CInt(Value), GetType(ContentAlignment))
    End If
    If m_ImageAlign = Value Then Return
    m_ImageAlign = Value
    Invalidate()
  End Set
  End Property

  &#39;RoundCorners
  &amp;lt;Category(&quot;Appearance&quot;), _
  DefaultValue(GetType(Corners), &quot;None&quot;), _
  Description(&quot;Gets/sets the corners of the control to round.&quot;), _
  Editor(GetType(RoundCornersEditor), GetType(UITypeEditor)), _
  DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)&amp;gt; _
  Public Property RoundCorners() As Corners
  Get
    Return m_RoundCorners
  End Get
  Set(ByVal Value As Corners)
    If m_RoundCorners = Value Then Return
    m_RoundCorners = Value
    Me.Invalidate()
  End Set
  End Property

  &#39;TextAlign
  &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(GetType(ContentAlignment), &quot;MiddleCenter&quot;), _
  Description(&quot;The alignment of the text that will be displayed in the face of the control.&quot;)&amp;gt; _
  Public Property TextAlign() As ContentAlignment
  Get
    Return m_TextAlign
  End Get
  Set(ByVal Value As ContentAlignment)
    If Not [Enum].IsDefined(GetType(ContentAlignment), Value) Then
    Throw New InvalidEnumArgumentException(&quot;value&quot;, CInt(Value), GetType(ContentAlignment))
    End If
    If m_TextAlign = Value Then Return
    m_TextAlign = Value
    Invalidate()
  End Set
  End Property

  #End Region

  #Region &quot; Overriden Methods &quot;

  Protected Overrides Sub OnKeyDown(ByVal kevent As System.Windows.Forms.KeyEventArgs)
  MyBase.OnKeyDown(kevent)
  If kevent.KeyValue = Keys.Space Then
    keyPressed = True
    m_ButtonState = CustomButtonState.Pressed
  End If
  OnStateChange(EventArgs.Empty)
  End Sub

  Protected Overrides Sub OnKeyUp(ByVal kevent As System.Windows.Forms.KeyEventArgs)
  MyBase.OnKeyUp(kevent)
  If kevent.KeyValue = Keys.Space Then
    If Me.ButtonState = CustomButtonState.Pressed Then
    Me.PerformClick()
    End If
    keyPressed = False
    m_ButtonState = CustomButtonState.Focused
  End If
  OnStateChange(EventArgs.Empty)
  End Sub

  Protected Overrides Sub OnMouseEnter(ByVal eventargs As System.EventArgs)
  MyBase.OnMouseEnter(eventargs)
  If Not keyPressed Then
    m_ButtonState = CustomButtonState.Hot
  End If
  OnStateChange(eventargs.Empty)
  End Sub

  Protected Overrides Sub OnMouseLeave(ByVal eventargs As System.EventArgs)
  MyBase.OnMouseLeave(eventargs)
  If Not keyPressed Then
    If Me.IsDefault Then
    m_ButtonState = CustomButtonState.Focused
    Else
    m_ButtonState = CustomButtonState.Normal
    End If
  End If
  OnStateChange(eventargs.Empty)
  End Sub

  Protected Overrides Sub OnMouseDown(ByVal mevent As System.Windows.Forms.MouseEventArgs)
  MyBase.OnMouseDown(mevent)
  If mevent.Button = MouseButtons.Left Then
    Me.Focus()
    m_ButtonState = CustomButtonState.Pressed
  End If
  OnStateChange(EventArgs.Empty)
  End Sub

  Protected Overrides Sub OnMouseUp(ByVal mevent As System.Windows.Forms.MouseEventArgs)
  MyBase.OnMouseUp(mevent)
  m_ButtonState = CustomButtonState.Focused
  OnStateChange(EventArgs.Empty)
  End Sub

  Protected Overrides Sub OnMouseMove(ByVal mevent As System.Windows.Forms.MouseEventArgs)
  MyBase.OnMouseMove(mevent)
  If New Rectangle(Point.Empty, Me.Size).Contains(mevent.X, mevent.Y) AndAlso mevent.Button = MouseButtons.Left Then
    m_ButtonState = CustomButtonState.Pressed
  Else
    If keyPressed Then Return
    m_ButtonState = CustomButtonState.Hot
  End If
  OnStateChange(EventArgs.Empty)
  End Sub

  Protected Overrides Sub OnGotFocus(ByVal e As System.EventArgs)
  MyBase.OnGotFocus(e)
  m_ButtonState = CustomButtonState.Focused
  Me.NotifyDefault(True)
  End Sub

  Protected Overrides Sub OnLostFocus(ByVal e As System.EventArgs)
  MyBase.OnLostFocus(e)
  If Me.FindForm.Focused Then
    Me.NotifyDefault(False)
  End If
  m_ButtonState = CustomButtonState.Normal
  End Sub

  Protected Overrides Sub OnEnabledChanged(ByVal e As System.EventArgs)
  MyBase.OnEnabledChanged(e)
  If Me.Enabled Then
    m_ButtonState = CustomButtonState.Normal
  Else
    m_ButtonState = CustomButtonState.Disabled
  End If
  OnStateChange(EventArgs.Empty)
  End Sub

  Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
  &#39;Click gets fired before MouseUp which is handy
  If Me.ButtonState = CustomButtonState.Pressed Then
    Me.Focus()
    Me.PerformClick()
  End If
  End Sub

  Protected Overrides Sub OnDoubleClick(ByVal e As System.EventArgs)
  If Me.ButtonState = CustomButtonState.Pressed Then
    Me.Focus()
    Me.PerformClick()
  End If
  End Sub

  Protected Overrides Function ProcessMnemonic(ByVal charCode As Char) As Boolean
  If IsMnemonic(charCode, Me.Text) Then
    MyBase.OnClick(EventArgs.Empty)
    Return True
  End If
  Return MyBase.ProcessMnemonic(charCode)
  End Function

  Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
  MyBase.OnTextChanged(e)
  Me.Invalidate()
  End Sub

  Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)

  &#39;Simulate Transparency
  Dim g As System.Drawing.Drawing2D.GraphicsContainer = pevent.Graphics.BeginContainer()
  Dim translateRect As Rectangle = Me.Bounds
  pevent.Graphics.TranslateTransform(-Me.Left, -Me.Top)
  Dim pe As PaintEventArgs = New PaintEventArgs(pevent.Graphics, translateRect)
  Me.InvokePaintBackground(Me.Parent, pe)
  Me.InvokePaint(Me.Parent, pe)
  pevent.Graphics.ResetTransform()
  pevent.Graphics.EndContainer(g)

  pevent.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias

  Dim shadeColor, fillColor As Color
  Dim darkColor As Color = DarkenColor(Me.BackColor, 10)
  Dim darkDarkColor As Color = DarkenColor(Me.BackColor, 25)
  Dim lightColor As Color = LightenColor(Me.BackColor, 25)
  Dim lightLightColor As Color = LightenColor(Me.BackColor, 60)

  If Me.ButtonState = CustomButtonState.Hot Then
    fillColor = lightColor
    shadeColor = darkDarkColor
  ElseIf Me.ButtonState = CustomButtonState.Pressed Then
    fillColor = Me.BackColor
    shadeColor = Me.BackColor
  Else
    fillColor = Me.BackColor
    shadeColor = darkDarkColor
  End If

  Dim r As Rectangle = Me.ClientRectangle
  Dim path As Drawing2D.GraphicsPath = RoundRectangle(r, Me.CornerRadius, Me.RoundCorners)

  Dim paintBrush As New Drawing2D.LinearGradientBrush(r, fillColor, shadeColor, Drawing2D.LinearGradientMode.Vertical)

  &#39;We want a sharp change in the colors so define a Blend for the brush
  Dim b As New Drawing2D.Blend
  b.Positions = New Single() {0, 0.45, 0.55, 1}
  b.Factors = New Single() {0, 0, 1, 1}
  paintBrush.Blend = b

  &#39;Draw the Button Background
  pevent.Graphics.FillPath(paintBrush, path)
  paintBrush.Dispose()

  &#39;...and border
  Dim drawingPen As New Pen(darkDarkColor)
  pevent.Graphics.DrawPath(drawingPen, path)
  drawingPen.Dispose()

  &#39;Get the Rectangle to be used for Content
  Dim inBounds As Boolean
  &#39;We could use some Math to get this from the radius but I&#39;m 
  &#39;not great at Math so for the example this hack will suffice.
  While Not (inBounds) AndAlso r.Width &amp;gt;= 1 AndAlso r.Height &amp;gt;= 1
    inBounds = path.IsVisible(r.Left, r.Top) AndAlso _
    path.IsVisible(r.Right, r.Top) AndAlso _
    path.IsVisible(r.Left, r.Bottom) AndAlso _
    path.IsVisible(r.Right, r.Bottom)
    r.Inflate(-1, -1)

  End While

  contentRect = r

  End Sub

  Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
  DrawImage(e.Graphics)
  DrawText(e.Graphics)
  DrawFocus(e.Graphics)
  MyBase.OnPaint(e)
  End Sub

  Protected Overrides Sub OnParentBackColorChanged(ByVal e As System.EventArgs)
  MyBase.OnParentBackColorChanged(e)
  Me.Invalidate()
  End Sub

  Protected Overrides Sub OnParentBackgroundImageChanged(ByVal e As System.EventArgs)
  MyBase.OnParentBackgroundImageChanged(e)
  Me.Invalidate()
  End Sub

  #End Region

  #Region &quot; Internal Draw Methods &quot;

  Private Sub DrawImage(ByVal g As Graphics)

  If Me.ImageList Is Nothing OrElse Me.ImageIndex = -1 Then Return
  If Me.ImageIndex &amp;lt; 0 OrElse Me.ImageIndex &amp;gt;= Me.ImageList.Images.Count Then Return

  Dim _Image As Image = Me.ImageList.Images(Me.ImageIndex)

  Dim pt As Point

  Select Case Me.ImageAlign

    Case ContentAlignment.TopLeft
    pt.X = contentRect.Left
    pt.Y = contentRect.Top

    Case ContentAlignment.TopCenter
    pt.X = (Width - _Image.Width) \ 2
    pt.Y = contentRect.Top

    Case ContentAlignment.TopRight
    pt.X = contentRect.Right - _Image.Width
    pt.Y = contentRect.Top

    Case ContentAlignment.MiddleLeft
    pt.X = contentRect.Left
    pt.Y = (Height - _Image.Height) \ 2

    Case ContentAlignment.MiddleCenter
    pt.X = (Width - _Image.Width) \ 2
    pt.Y = (Height - _Image.Height) \ 2

    Case ContentAlignment.MiddleRight
    pt.X = contentRect.Right - _Image.Width
    pt.Y = (Height - _Image.Height) \ 2

    Case ContentAlignment.BottomLeft
    pt.X = contentRect.Left
    pt.Y = contentRect.Bottom - _Image.Height

    Case ContentAlignment.BottomCenter
    pt.X = (Width - _Image.Width) \ 2
    pt.Y = contentRect.Bottom - _Image.Height

    Case ContentAlignment.BottomRight
    pt.X = contentRect.Right - _Image.Width
    pt.Y = contentRect.Bottom - _Image.Height

  End Select

  If Me.ButtonState = CustomButtonState.Pressed Then
    pt.Offset(1, 1)
  End If

  If Me.Enabled Then
    Me.ImageList.Draw(g, pt, Me.ImageIndex)
  Else
    ControlPaint.DrawImageDisabled(g, _Image, pt.X, pt.Y, Me.BackColor)
  End If

  End Sub

  Private Sub DrawText(ByVal g As Graphics)

  Dim TextBrush As New SolidBrush(Me.ForeColor)

  Dim R As RectangleF = RectangleF.op_Implicit(contentRect)

  If Not Me.Enabled Then TextBrush.Color = SystemColors.GrayText

  Dim sf As New StringFormat(StringFormatFlags.NoWrap Or StringFormatFlags.NoClip)

  If ShowKeyboardCues Then
    sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show
  Else
    sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide
  End If

  Select Case Me.TextAlign
    Case ContentAlignment.TopLeft
    sf.Alignment = StringAlignment.Near
    sf.LineAlignment = StringAlignment.Near

    Case ContentAlignment.TopCenter
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Near

    Case ContentAlignment.TopRight
    sf.Alignment = StringAlignment.Far
    sf.LineAlignment = StringAlignment.Near

    Case ContentAlignment.MiddleLeft
    sf.Alignment = StringAlignment.Near
    sf.LineAlignment = StringAlignment.Center

    Case ContentAlignment.MiddleCenter
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Center

    Case ContentAlignment.MiddleRight
    sf.Alignment = StringAlignment.Far
    sf.LineAlignment = StringAlignment.Center

    Case ContentAlignment.BottomLeft
    sf.Alignment = StringAlignment.Near
    sf.LineAlignment = StringAlignment.Far

    Case ContentAlignment.BottomCenter
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Far

    Case ContentAlignment.BottomRight
    sf.Alignment = StringAlignment.Far
    sf.LineAlignment = StringAlignment.Far

  End Select

  If Me.ButtonState = CustomButtonState.Pressed Then
    R.Offset(1, 1)
  End If

  If Me.Enabled Then
    g.DrawString(Me.Text, Me.Font, TextBrush, R, sf)
  Else
    ControlPaint.DrawStringDisabled(g, Me.Text, Me.Font, Me.BackColor, R, sf)
  End If

  End Sub

  Private Sub DrawFocus(ByVal g As Graphics)
  Dim r As Rectangle = contentRect
  r.Inflate(1, 1)
  If Me.Focused AndAlso Me.ShowFocusCues AndAlso Me.TabStop Then
    ControlPaint.DrawFocusRectangle(g, r, Me.ForeColor, Me.BackColor)
  End If

  End Sub

  #End Region

  #Region &quot; Helper Methods &quot;

  Private Function RoundRectangle(ByVal r As Rectangle, ByVal radius As Int32, ByVal corners As Corners) As System.Drawing.Drawing2D.GraphicsPath

  &#39;Make sure the Path fits inside the rectangle
  r.Width -= 1
  r.Height -= 1

  &#39;Scale the radius if it&#39;s too large to fit.
  If (radius &amp;gt; (r.Width)) Then radius = r.Width
  If (radius &amp;gt; (r.Height)) Then radius = r.Height

  Dim path As New System.Drawing.Drawing2D.GraphicsPath

  If radius &amp;lt;= 0 Then
    path.AddRectangle(r)
  Else
    If (corners And corners.TopLeft) = corners.TopLeft Then
    path.AddArc(r.Left, r.Top, radius, radius, 180, 90)
    Else
    path.AddLine(r.Left, r.Top, r.Left, r.Top)
    End If

    If (corners And corners.TopRight) = corners.TopRight Then
    path.AddArc(r.Right - radius, r.Top, radius, radius, 270, 90)
    Else
    path.AddLine(r.Right, r.Top, r.Right, r.Top)
    End If


    If (corners And corners.BottomRight) = corners.BottomRight Then
    path.AddArc(r.Right - radius, r.Bottom - radius, radius, radius, 0, 90)
    Else
    path.AddLine(r.Right, r.Bottom, r.Right, r.Bottom)
    End If

    If (corners And corners.BottomLeft) = corners.BottomLeft Then
    path.AddArc(r.Left, r.Bottom - radius, radius, radius, 90, 90)
    Else
    path.AddLine(r.Left, r.Bottom, r.Left, r.Bottom)
    End If

    path.CloseFigure()

  End If

  Return path

  End Function

  &#39;The ControlPaint Class has methods to Lighten and Darken Colors, but they return a Solid Color.
  &#39;The Following 2 methods return a modified color with original Alpha.
  Private Function DarkenColor(ByVal colorIn As Color, ByVal percent As Int32) As Color
  &#39;This method returns Black if you Darken by 100%

  If percent &amp;lt; 0 OrElse percent &amp;gt; 100 Then
    Throw New ArgumentOutOfRangeException(&quot;percent&quot;)
  End If

  Dim a, r, g, b As Int32

  a = colorIn.A
  r = colorIn.R - CInt((colorIn.R / 100) * percent)
  g = colorIn.G - CInt((colorIn.G / 100) * percent)
  b = colorIn.B - CInt((colorIn.B / 100) * percent)

  Return Color.FromArgb(a, r, g, b)

  End Function

  Private Function LightenColor(ByVal colorIn As Color, ByVal percent As Int32) As Color

  &#39;This method returns White if you lighten by 100%
  If percent &amp;lt; 0 OrElse percent &amp;gt; 100 Then
    Throw New ArgumentOutOfRangeException(&quot;percent&quot;)
  End If

  Dim a, r, g, b As Int32

  a = colorIn.A
  r = colorIn.R + CInt(((255 - colorIn.R) / 100) * percent)
  g = colorIn.G + CInt(((255 - colorIn.G) / 100) * percent)
  b = colorIn.B + CInt(((255 - colorIn.B) / 100) * percent)

  Return Color.FromArgb(a, r, g, b)
  End Function

  #End Region

  Private Sub OnStateChange(ByVal e As EventArgs)
  Static currentState As CustomButtonState
  &#39;Repaint the button only if the state has actually changed
  If Me.ButtonState = currentState Then Return
  currentState = Me.ButtonState
  Me.Invalidate()
  End Sub

  End Class

  #Region &quot; Custom TypeEditor for RoundCorners property &quot;

  &amp;lt;PermissionSetAttribute(SecurityAction.LinkDemand, Unrestricted:=True), PermissionSetAttribute(SecurityAction.InheritanceDemand, Unrestricted:=True)&amp;gt; _
  Public Class RoundCornersEditor
  Inherits UITypeEditor

  Public Overloads Overrides Function GetEditStyle(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.Drawing.Design.UITypeEditorEditStyle
  Return UITypeEditorEditStyle.DropDown
  End Function

  Public Overloads Overrides Function EditValue(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal provider As System.IServiceProvider, ByVal value As Object) As Object

  If Not TypeOf value Is Corners OrElse _
    provider Is Nothing Then
    Return value
  End If

  Dim edSvc As IWindowsFormsEditorService = CType(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
  If Not (edSvc Is Nothing) Then
    Dim lb As New CheckedListBox
    lb.BorderStyle = System.Windows.Forms.BorderStyle.None
    lb.CheckOnClick = True

    lb.Items.Add(&quot;TopLeft&quot;, (DirectCast(context.Instance, CustomButton).RoundCorners And Corners.TopLeft) = Corners.TopLeft)
    lb.Items.Add(&quot;TopRight&quot;, (DirectCast(context.Instance, CustomButton).RoundCorners And Corners.TopRight) = Corners.TopRight)
    lb.Items.Add(&quot;BottomLeft&quot;, (DirectCast(context.Instance, CustomButton).RoundCorners And Corners.BottomLeft) = Corners.BottomLeft)
    lb.Items.Add(&quot;BottomRight&quot;, (DirectCast(context.Instance, CustomButton).RoundCorners And Corners.BottomRight) = Corners.BottomRight)

    edSvc.DropDownControl(lb)
    Dim cornerFlags As Corners
    For Each o As Object In lb.CheckedItems
    cornerFlags = cornerFlags Or DirectCast([Enum].Parse(GetType(Corners), o.ToString), Corners)
    Next
    lb.Dispose()
    edSvc.CloseDropDown()
    Return cornerFlags
  End If

  Return value

  End Function

  End Class

  #End Region

  End Namespace
    &lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System;
  using System.ComponentModel;
  using System.Drawing;
  using System.Drawing.Design;
  using System.Windows.Forms;
  using System.Windows.Forms.Design;
  using System.Security.Permissions;

  namespace Dotnetrix.Samples.CSharp
  {
    [System.Flags]
    public enum Corners
    {
    None = 0,
    TopLeft = 1,
    TopRight = 2,
    BottomLeft = 4,
    BottomRight = 8,
    All = TopLeft | TopRight | BottomLeft | BottomRight
    }


    public enum CustomButtonState
    {
    Normal = 1,
    Hot,
    Pressed,
    Disabled,
    Focused
    }


    public class CustomButton : Control, IButtonControl
    {
    public CustomButton():base()
    {
      this.SetStyle(ControlStyles.Selectable | ControlStyles.StandardClick | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor, true);
    }


  #region Private Instance Variables

    private DialogResult m_DialogResult;
    private bool m_IsDefault;
    
    private int m_CornerRadius  = 8;
    private Corners m_RoundCorners;
    private CustomButtonState m_ButtonState = CustomButtonState.Normal;
    
    private ContentAlignment m_ImageAlign = ContentAlignment.MiddleCenter;
    private ContentAlignment m_TextAlign = ContentAlignment.MiddleCenter;
    private ImageList m_ImageList;
    private int m_ImageIndex = -1;
    
    private bool keyPressed;
    private Rectangle contentRect;

  #endregion

  #region IButtonControl Implementation

    [Category(&quot;Behavior&quot;), DefaultValue(typeof(DialogResult), &quot;None&quot;)]
    [Description(&quot;The dialog result produced in a modal form by clicking the button.&quot;)]
    public DialogResult DialogResult
    {
      get{return m_DialogResult;}
      set
      {
        if (Enum.IsDefined(typeof(DialogResult), value))
        m_DialogResult = value;
      }
    }
    

    public void NotifyDefault(bool value)
    {
      if (m_IsDefault != value)
        m_IsDefault = value;
      this.Invalidate();
    }


    public void PerformClick()
    {
      if (this.CanSelect)
        base.OnClick(EventArgs.Empty);
    }


  #endregion

  #region Properties

    //ButtonState
    [Browsable(false)]
    public CustomButtonState ButtonState
    {
      get{return m_ButtonState;}
    }


    //CornerRadius
    [Category(&quot;Appearance&quot;)]
    [DefaultValue(8)]
    [Description(&quot;Defines the radius of the controls RoundedCorners.&quot;)]
    public int CornerRadius
    {
      get{return m_CornerRadius;}
      set
      {
        if (m_CornerRadius == value) 
        return;
        m_CornerRadius = value;
        this.Invalidate();
      }
    }


    //DefaultSize
    protected override System.Drawing.Size DefaultSize
    {
      get{return new Size(75, 23);}
    }


    //IsDefault
    [Browsable(false)]
    public bool IsDefault
    {
      get{return m_IsDefault;}
    }


    //ImageList
    [Category(&quot;Appearance&quot;), DefaultValue(typeof(ImageList), null)]
    [Description(&quot;The image list to get the image to display in the face of the control.&quot;)]
    public ImageList ImageList
    {
      get{return m_ImageList;}
      set
      {
        m_ImageList = value;
        this.Invalidate();
      }
    }


    //ImageIndex
    [Category(&quot;Appearance&quot;), DefaultValue(-1)]
    [Description(&quot;The index of the image in the image list to display in the face of the control.&quot;)]
    [TypeConverter(typeof(ImageIndexConverter))]
    [Editor(&quot;System.Windows.Forms.Design.ImageIndexEditor, System.Design&quot;, typeof(System.Drawing.Design.UITypeEditor))]
    public int ImageIndex
    {
      get{return m_ImageIndex;}
      set
      {
        m_ImageIndex = value;
        this.Invalidate();
      }
    }


    //ImageAlign
    [Category(&quot;Appearance&quot;), DefaultValue(typeof(ContentAlignment), &quot;MiddleCenter&quot;)]
    [Description(&quot;The alignment of the image that will be displayed in the face of the control.&quot;)]
    public ContentAlignment ImageAlign
    {
      get{return m_ImageAlign;}
      set
      {
        if (!Enum.IsDefined(typeof(ContentAlignment), value))
        throw new InvalidEnumArgumentException(&quot;value&quot;, (int)value, typeof(ContentAlignment));
        if (m_ImageAlign == value )
        return;
        m_ImageAlign = value;
        this.Invalidate();
      }
    }


    //RoundCorners
    [Category(&quot;Appearance&quot;)]
    [DefaultValue(typeof(Corners), &quot;None&quot;)]
    [Description(&quot;Gets/sets the corners of the control to round.&quot;)]
    [Editor(typeof(RoundCornersEditor), typeof(UITypeEditor))]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
    public Corners RoundCorners
    {
      get{return m_RoundCorners;}
      set
      {
        if (m_RoundCorners == value)
        return;
        m_RoundCorners = value;
        this.Invalidate();
      }
    }


    //TextAlign
    [Category(&quot;Appearance&quot;), DefaultValue(typeof(ContentAlignment), &quot;MiddleCenter&quot;)]
    [Description(&quot;The alignment of the text that will be displayed in the face of the control.&quot;)]
    public ContentAlignment TextAlign
    {
      get{return m_TextAlign;}
      set
      {
        if (!Enum.IsDefined(typeof(ContentAlignment), value))
        throw new InvalidEnumArgumentException(&quot;value&quot;, (int)value, typeof(ContentAlignment));
        if (m_TextAlign == value)
        return;
        m_TextAlign = value;
        this.Invalidate();
      }
    }


  #endregion

  #region Overriden Methods

    protected override void OnKeyDown(KeyEventArgs e)
    {
      base.OnKeyDown (e);
      if (e.KeyCode == Keys.Space)
      {
        keyPressed = true;
        m_ButtonState = CustomButtonState.Pressed;
      }
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnKeyUp(KeyEventArgs e)
    {
      base.OnKeyUp (e);
      if (e.KeyCode == Keys.Space)
      {
        if (this.ButtonState == CustomButtonState.Pressed)
        this.PerformClick();
        keyPressed = false;
        m_ButtonState = CustomButtonState.Focused;
      }
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnMouseEnter(EventArgs e)
    {
      base.OnMouseEnter (e);
      if (!keyPressed)
        m_ButtonState = CustomButtonState.Hot;
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnMouseLeave(EventArgs e)
    {
      base.OnMouseLeave (e);
      if (!keyPressed)
        if (this.IsDefault)
        m_ButtonState = CustomButtonState.Focused;
        else
        m_ButtonState = CustomButtonState.Normal;
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnMouseDown(MouseEventArgs e)
    {
      base.OnMouseDown (e);
      if (e.Button == MouseButtons.Left)
      {
        this.Focus();
        m_ButtonState = CustomButtonState.Pressed;
      }
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnMouseUp(MouseEventArgs e)
    {
      base.OnMouseUp (e);
      m_ButtonState = CustomButtonState.Focused;
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnMouseMove(MouseEventArgs e)
    {
      base.OnMouseMove (e);
      if (new Rectangle(Point.Empty, this.Size).Contains(e.X, e.Y) &amp;amp;&amp;amp; e.Button == MouseButtons.Left)
        m_ButtonState = CustomButtonState.Pressed;
      else
      {
        if(keyPressed)
        return;
        m_ButtonState = CustomButtonState.Hot;
      }
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnGotFocus(EventArgs e)
    {
      base.OnGotFocus (e);
      m_ButtonState = CustomButtonState.Focused;
      this.NotifyDefault(true);
    }


    protected override void OnLostFocus(EventArgs e)
    {
      base.OnLostFocus (e);
      if (this.FindForm().Focused)
        this.NotifyDefault(false);
      m_ButtonState = CustomButtonState.Normal;
    }


    protected override void OnEnabledChanged(EventArgs e)
    {
      base.OnEnabledChanged (e);
      if (this.Enabled)
        m_ButtonState = CustomButtonState.Normal;
      else
        m_ButtonState = CustomButtonState.Disabled;
      OnStateChange(EventArgs.Empty);
    }


    protected override void OnClick(EventArgs e)
    {
      //Click gets fired before MouseUp which is handy
      if (this.ButtonState == CustomButtonState.Pressed)
      {
        this.Focus();
        this.PerformClick();
      }
    }


    protected override void OnDoubleClick(EventArgs e)
    {
      if (this.ButtonState == CustomButtonState.Pressed)
      {
        this.Focus();
        this.PerformClick();
      }
    }


    protected override bool ProcessMnemonic(char charCode)
    {
      if (IsMnemonic(charCode, this.Text))
      {
        base.OnClick(EventArgs.Empty);
        return true;
      }
      return base.ProcessMnemonic(charCode);
    }


    protected override void OnTextChanged(EventArgs e)
    {
      base.OnTextChanged(e);
      this.Invalidate();
    }


    protected override void OnPaintBackground(PaintEventArgs pevent)
    {
      //Simulate Transparency
      System.Drawing.Drawing2D.GraphicsContainer g = pevent.Graphics.BeginContainer();
      Rectangle translateRect = this.Bounds;
      pevent.Graphics.TranslateTransform(-this.Left, -this.Top);
      PaintEventArgs pe = new PaintEventArgs(pevent.Graphics, translateRect);
      this.InvokePaintBackground(this.Parent, pe);
      this.InvokePaint(this.Parent, pe);
      pevent.Graphics.ResetTransform();
      pevent.Graphics.EndContainer(g);

      pevent.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

      Color shadeColor, fillColor; 
      Color darkColor = DarkenColor(this.BackColor, 10);
      Color darkDarkColor = DarkenColor(this.BackColor, 25);
      Color lightColor = LightenColor(this.BackColor, 25);
      Color lightLightColor = LightenColor(this.BackColor, 60);

      if (this.ButtonState == CustomButtonState.Hot)
      {
        fillColor = lightColor;
        shadeColor = darkDarkColor;
      }
      else if (this.ButtonState == CustomButtonState.Pressed)
      {
        fillColor = this.BackColor;
        shadeColor = this.BackColor;
      }
      else
      {
        fillColor = this.BackColor;
        shadeColor = darkDarkColor;
      }

      Rectangle r = this.ClientRectangle;
      System.Drawing.Drawing2D.GraphicsPath path = RoundRectangle(r, this.CornerRadius, this.RoundCorners);

      System.Drawing.Drawing2D.LinearGradientBrush paintBrush = new System.Drawing.Drawing2D.LinearGradientBrush(r, fillColor, shadeColor, System.Drawing.Drawing2D.LinearGradientMode.Vertical);

      //We want a sharp change in the colors so define a Blend for the brush
      System.Drawing.Drawing2D.Blend b = new System.Drawing.Drawing2D.Blend();
      b.Positions = new float[] {0, 0.45F, 0.55F, 1};
      b.Factors = new float[] {0, 0, 1, 1};
      paintBrush.Blend = b;

      //Draw the Button Background
      pevent.Graphics.FillPath(paintBrush, path);
      paintBrush.Dispose();

      //...and border
      Pen drawingPen = new Pen(darkDarkColor);
      pevent.Graphics.DrawPath(drawingPen, path);
      drawingPen.Dispose();

      //Get the Rectangle to be used for Content
      bool inBounds = false;
      //We could use some Math to get this from the radius but I&#39;m 
      //not great at Math so for the example this hack will suffice.
      while (!inBounds &amp;amp;&amp;amp; r.Width &amp;gt;= 1 &amp;amp;&amp;amp; r.Height &amp;gt;= 1)
      {
        inBounds = path.IsVisible(r.Left, r.Top) &amp;amp;&amp;amp;
            path.IsVisible(r.Right, r.Top) &amp;amp;&amp;amp;
            path.IsVisible(r.Left, r.Bottom) &amp;amp;&amp;amp;
            path.IsVisible(r.Right, r.Bottom);
        r.Inflate(-1, -1);
        
      }

      contentRect = r;

    }


    protected override void OnPaint(PaintEventArgs e)
    {
      DrawImage(e.Graphics);
      DrawText(e.Graphics);
      DrawFocus(e.Graphics);
      base.OnPaint (e);
    }


    protected override void OnParentBackColorChanged(EventArgs e)
    {
      base.OnParentBackColorChanged (e);
      this.Invalidate();
    }


    protected override void OnParentBackgroundImageChanged(EventArgs e)
    {
      base.OnParentBackgroundImageChanged (e);
      this.Invalidate();
    }


  #endregion

  #region Internal Draw Methods

    private void DrawImage(Graphics g)
    {
      if (this.ImageList == null || this.ImageIndex == -1)
        return;
      if (this.ImageIndex &amp;lt; 0 || this.ImageIndex &amp;gt;= this.ImageList.Images.Count)
        return;

      Image _Image = this.ImageList.Images[this.ImageIndex];

      Point pt = Point.Empty;

      switch (this.ImageAlign)
      {
        case ContentAlignment.TopLeft:
        pt.X = contentRect.Left;
        pt.Y = contentRect.Top;
        break;

        case ContentAlignment.TopCenter:
        pt.X = (Width - _Image.Width) / 2;
        pt.Y = contentRect.Top;
        break;

        case ContentAlignment.TopRight:
        pt.X = contentRect.Right - _Image.Width;
        pt.Y = contentRect.Top;
        break;

        case ContentAlignment.MiddleLeft:
        pt.X = contentRect.Left;
        pt.Y = (Height - _Image.Height) / 2;
        break;

        case ContentAlignment.MiddleCenter:
        pt.X = (Width - _Image.Width) / 2;
        pt.Y = (Height - _Image.Height) / 2;
        break;

        case ContentAlignment.MiddleRight:
        pt.X = contentRect.Right - _Image.Width;
        pt.Y = (Height - _Image.Height) / 2;
        break;

        case ContentAlignment.BottomLeft:
        pt.X = contentRect.Left;
        pt.Y = contentRect.Bottom - _Image.Height;
        break;

        case ContentAlignment.BottomCenter:
        pt.X = (Width - _Image.Width) / 2;
        pt.Y = contentRect.Bottom - _Image.Height;
        break;

        case ContentAlignment.BottomRight:
        pt.X = contentRect.Right - _Image.Width;
        pt.Y = contentRect.Bottom - _Image.Height;
        break;
      }

      if (this.ButtonState == CustomButtonState.Pressed)
        pt.Offset(1, 1);

      if (this.Enabled)
        this.ImageList.Draw(g, pt, this.ImageIndex);
      else
        ControlPaint.DrawImageDisabled(g, _Image, pt.X, pt.Y, this.BackColor);

    }


    private void DrawText(Graphics g)
    {
      SolidBrush TextBrush = new SolidBrush(this.ForeColor);
      
      RectangleF R = (RectangleF)contentRect;
      
      if (!this.Enabled)
        TextBrush.Color = SystemColors.GrayText;
      
      StringFormat sf = new StringFormat(StringFormatFlags.NoWrap | StringFormatFlags.NoClip);
      
      if (ShowKeyboardCues)
        sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
      else
        sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide;
      
      switch (this.TextAlign)
      {
        case ContentAlignment.TopLeft:
        sf.Alignment = StringAlignment.Near;
        sf.LineAlignment = StringAlignment.Near;
        break;

        case ContentAlignment.TopCenter:
        sf.Alignment = StringAlignment.Center;
        sf.LineAlignment = StringAlignment.Near;
        break;

        case ContentAlignment.TopRight:
        sf.Alignment = StringAlignment.Far;
        sf.LineAlignment = StringAlignment.Near;
        break;
        
        case ContentAlignment.MiddleLeft:
        sf.Alignment = StringAlignment.Near;
        sf.LineAlignment = StringAlignment.Center;
        break;

        case ContentAlignment.MiddleCenter:
        sf.Alignment = StringAlignment.Center;
        sf.LineAlignment = StringAlignment.Center;
        break;

        case ContentAlignment.MiddleRight:
        sf.Alignment = StringAlignment.Far;
        sf.LineAlignment = StringAlignment.Center;
        break;

        case ContentAlignment.BottomLeft:
        sf.Alignment = StringAlignment.Near;
        sf.LineAlignment = StringAlignment.Far;
        break;

        case ContentAlignment.BottomCenter:
        sf.Alignment = StringAlignment.Center;
        sf.LineAlignment = StringAlignment.Far;
        break;

        case ContentAlignment.BottomRight:
        sf.Alignment = StringAlignment.Far;
        sf.LineAlignment = StringAlignment.Far;
        break;
      }

      if (this.ButtonState == CustomButtonState.Pressed)
        R.Offset(1, 1);

      if (this.Enabled)
        g.DrawString(this.Text, this.Font, TextBrush, R, sf);
      else
        ControlPaint.DrawStringDisabled(g, this.Text, this.Font, this.BackColor, R, sf);
      
    }


    private void DrawFocus(Graphics g)
    {
      Rectangle r = contentRect;
      r.Inflate(1, 1);
      if (this.Focused &amp;amp;&amp;amp; this.ShowFocusCues &amp;amp;&amp;amp; this.TabStop)
        ControlPaint.DrawFocusRectangle(g, r, this.ForeColor, this.BackColor);
    }

    
  #endregion

  #region Helper Methods

    private System.Drawing.Drawing2D.GraphicsPath RoundRectangle(Rectangle r, int radius, Corners corners)
    {
      //Make sure the Path fits inside the rectangle
      r.Width -= 1;
      r.Height -= 1;
      
      //Scale the radius if it&#39;s too large to fit.
      if (radius &amp;gt; (r.Width))
        radius = r.Width;
      if (radius &amp;gt; (r.Height))
        radius = r.Height;
      
      System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();
      
      if (radius &amp;lt;= 0 )
        path.AddRectangle(r);
      else
        if ((corners &amp;amp; Corners.TopLeft) == Corners.TopLeft)
        path.AddArc(r.Left, r.Top, radius, radius, 180, 90);
      else
        path.AddLine(r.Left, r.Top, r.Left, r.Top);
      
      if ((corners &amp;amp; Corners.TopRight) == Corners.TopRight)
        path.AddArc(r.Right - radius, r.Top, radius, radius, 270, 90);
      else
        path.AddLine(r.Right, r.Top, r.Right, r.Top);
      
      if ((corners &amp;amp; Corners.BottomRight) == Corners.BottomRight)
        path.AddArc(r.Right - radius, r.Bottom - radius, radius, radius, 0, 90);
      else
        path.AddLine(r.Right, r.Bottom, r.Right, r.Bottom);
      
      if ((corners &amp;amp; Corners.BottomLeft) == Corners.BottomLeft)
        path.AddArc(r.Left, r.Bottom - radius, radius, radius, 90, 90);
      else
        path.AddLine(r.Left, r.Bottom, r.Left, r.Bottom);
      
      path.CloseFigure();

      return path;
    }


    //The ControlPaint Class has methods to Lighten and Darken Colors, but they return a Solid Color.
    //The Following 2 methods return a modified color with original Alpha.
    private Color DarkenColor(Color colorIn, int percent)
    {
      //This method returns Black if you Darken by 100%
      
      if (percent &amp;lt; 0 || percent &amp;gt; 100)
        throw new ArgumentOutOfRangeException(&quot;percent&quot;);
      
      int a, r, g, b;
      
      a = colorIn.A;
      r = colorIn.R - (int)((colorIn.R / 100f) * percent);
      g = colorIn.G - (int)((colorIn.G / 100f) * percent);
      b = colorIn.B - (int)((colorIn.B / 100f) * percent);
      
      return Color.FromArgb(a, r, g, b);
    }
    

    private Color LightenColor(Color colorIn, int percent)
    {
      //This method returns White if you lighten by 100%
      
      if (percent &amp;lt; 0 || percent &amp;gt; 100)
        throw new ArgumentOutOfRangeException(&quot;percent&quot;);
      
      int a, r, g, b;
      
      a = colorIn.A;
      r = colorIn.R + (int)(((255f - colorIn.R) / 100f) * percent);
      g = colorIn.G + (int)(((255f - colorIn.G) / 100f) * percent);
      b = colorIn.B + (int)(((255f - colorIn.B) / 100f) * percent);
      
      return Color.FromArgb(a, r, g, b);
    }


  #endregion

    private CustomButtonState currentState; 
    private void OnStateChange(EventArgs e)
    {
      //Repaint the button only if the state has actually changed
      if (this.ButtonState == currentState)
        return;
      currentState = this.ButtonState;
      this.Invalidate();
    }


    }

  #region Custom TypeEditor for RoundCorners property

    [PermissionSetAttribute(SecurityAction.LinkDemand, Unrestricted=true)]
    [PermissionSetAttribute(SecurityAction.InheritanceDemand, Unrestricted=true)]
    public class RoundCornersEditor : UITypeEditor
    {
    public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    {
      return UITypeEditorEditStyle.DropDown;
    }
    
    public override Object EditValue(ITypeDescriptorContext context, IServiceProvider provider, Object value)
    {
      if (value != typeof(Corners) ||  provider == null)
        return value;
      
      IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
      if (edSvc != null)
      {
        CheckedListBox lb = new CheckedListBox();
        lb.BorderStyle = BorderStyle.None;
        lb.CheckOnClick = true;
        
        lb.Items.Add(&quot;TopLeft&quot;, (((CustomButton)context.Instance).RoundCorners &amp;amp; Corners.TopLeft) == Corners.TopLeft);
        lb.Items.Add(&quot;TopRight&quot;, (((CustomButton)context.Instance).RoundCorners &amp;amp; Corners.TopRight) == Corners.TopRight);
        lb.Items.Add(&quot;BottomLeft&quot;, (((CustomButton)context.Instance).RoundCorners &amp;amp; Corners.BottomLeft) == Corners.BottomLeft);
        lb.Items.Add(&quot;BottomRight&quot;, (((CustomButton)context.Instance).RoundCorners &amp;amp; Corners.BottomRight) == Corners.BottomRight);

        edSvc.DropDownControl(lb);
        Corners cornerFlags = Corners.None;
        foreach (object o in lb.CheckedItems)
        {
        cornerFlags = cornerFlags | (Corners)Enum.Parse(typeof(Corners), o.ToString());
        }
        lb.Dispose();
        edSvc.CloseDropDown();
        return cornerFlags;
      }
      return value;
    }
    
    }

  #endregion

  }
       &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/1723495820479380511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/create-custom-button-in-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1723495820479380511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1723495820479380511'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/create-custom-button-in-form.html' title='Create Custom Button in Form'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9VvHdYxwguHGu3fyHW_W7WpDNztXzjY-mdfueE0ZDSQ7yZJ6FIv0bvdyT3csnZxxMulrjcJ-Zr6VB59KXpnXHINzl9DqqzQTr-Te2Vmsso5uR2YIsgt8JW4ElSrZk_HVZerJxx9OzVNc/s72-c/Create+Custom+Button+in+Form+VB+net+Csharp.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-3819300420346585684</id><published>2011-07-23T13:23:00.000-07:00</published><updated>2011-07-23T13:23:32.511-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom Control"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Custom Tab Control With Cool Appearance</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;             &lt;img alt=&quot;&quot; height=&quot;254&quot; src=&quot;http://dotnetrix.co.uk/images/tabcontrolex.png&quot; width=&quot;464&quot; /&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
03 Feb 2005 - New Bevel Appearance added and Draw Methods exposed for Inheritance Overrides.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;             &lt;img alt=&quot;&quot; height=&quot;111&quot; src=&quot;http://dotnetrix.co.uk/images/tabcontrolexbevel.png&quot; width=&quot;338&quot; /&gt;&lt;/div&gt;20 Feb 2005 - Keyboard and mouse navigation improved to ignore/skip-over disabled TabPages.&lt;br /&gt;
Enabled property exposed on TabPageEX and modifications made so as to comply with Microsoft FxCop rules.&lt;br /&gt;
17 May 2005 - Bug Fix: SelectedIndexChanged was being fired twice when tab changed by mouse.&lt;br /&gt;
25 May 2005 - Bug Fix: When used with some 3rd party control  libraries the TabAppearanceEX Enumeration was &#39;misplaced&#39; by the IDE.  This was due to nesting and so the enum has been moved. Also fixed a few  new FXCop violations and added a custom designer to TabpageEX as the  control misbehaved in VS2005 when using the standard tabpage designer.&lt;br /&gt;
11 June 2005 - Added InsertTabPage method and implemented the TabPageEX Hide() and Show() methods.&lt;br /&gt;
27 June 2005 - Added Visual Styles Support.&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;             &lt;img alt=&quot;&quot; height=&quot;271&quot; src=&quot;http://dotnetrix.co.uk/images/tabcontrolexvs.png&quot; width=&quot;490&quot; /&gt;&lt;/div&gt;29 July 2005 - Added GroupBoxEX to the dll. Leave GroupBoxEX  at FlatStyle.Standard as I have overridden the OnPaintBackGround() and  OnPaint() methods to draw the control with Visual Style as necessary.  Set the GroupBoxEX&#39;s BackColor property to Transparent and you should  see the Themed Tabpage background (when it&#39;s on a themed tabpage). The  only problem with this being that all controls added to the GroupBoxEX  will inherit the Transparent Background color.&lt;br /&gt;
11 August 2005 - Bug Fix: Arrow Key navigated tabs even when  Tabcontrol not focused, eg; when textbox as child of tabpage was  selected.&lt;br /&gt;
24 March 2006 - Bug Fix: MouseDown and Click events were not being fired.&lt;br /&gt;
06 Dec 2006 - Bug Fix: Null Reference exception was raised randomly when changing TabPage Selection. Thanks to &lt;a href=&quot;http://www.dfpc.net/&quot;&gt;Sam J Martinez&lt;/a&gt; for his help in locating and fixing this bug.&lt;br /&gt;
22 March 2007 - Bug Fix: ArgumentException raised occasionally.&lt;br /&gt;
20 July 2007 - Bug Fix: Undo/Redo now works on the Design Surface.&lt;br /&gt;
21 October 2008 - Bug Fix: SelectedTabFontStyle defaulted to Regular rather than Controls Font.Style.&lt;br /&gt;
This control is a more complete version of the one shown in  my Tips page. Unlike the TabControl from which it Inherits, you can set  any Alignment value with any Appearance value.&lt;br /&gt;
An OnSelectedIndexChanging Method has been added to the TabControl so that you may cancel selection of a TabPage.&lt;br /&gt;
Disabled Tabs do not recieve a Click event.&lt;br /&gt;
Set AllowDrop and AllowTabDrag to True and you are able to drag TabItems around at runtime.&lt;br /&gt;
Mnemonic support has been added.&lt;br /&gt;
You may have to play around with Padding if you use non standard Font.&lt;br /&gt;
&lt;br /&gt;
&lt;a class=&quot;button&quot; href=&quot;http://dotnetrix.co.uk/download/TabControlEX.zip&quot;&gt;Download Here...&lt;/a&gt;&lt;br /&gt;
From: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Doherty&lt;/a&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/3819300420346585684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/custom-tab-control-with-cool-appearance.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/3819300420346585684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/3819300420346585684'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/custom-tab-control-with-cool-appearance.html' title='Custom Tab Control With Cool Appearance'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-892054362384169895</id><published>2011-07-23T13:20:00.000-07:00</published><updated>2011-07-23T13:20:38.773-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom Control"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Custom Menu Design With MenuSkinner</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://dotnetrix.co.uk/images/menuskinner.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Custom Menu Design With MenuSkinner&quot; border=&quot;0&quot; height=&quot;126&quot; src=&quot;http://dotnetrix.co.uk/images/menuskinner.png&quot; title=&quot;Custom Menu Design With MenuSkinner&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Drop a MenuSkin component on your form and standard menu items are extended with icon and font properties.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
The Menuskin component has several properties with which you can modify the menus appearance.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dotnetrix.co.uk/download/MenuSkinner.zip&quot;&gt;Click Here To Download (By Mick Doherty)&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/892054362384169895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/custom-menu-design-with-menuskinner.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/892054362384169895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/892054362384169895'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/custom-menu-design-with-menuskinner.html' title='Custom Menu Design With MenuSkinner'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-1445555717993805236</id><published>2011-07-22T10:26:00.000-07:00</published><updated>2011-07-22T10:26:20.942-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Menu Strip"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Create Menu Bar Like Office style Menu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7FXk4bTDM0aLECs2XZ2ZT4MBVJegv23b9KcP-iSjq8Q4rJcEB9pME8khD6IOprgq2m2l_f0bMp0_uBwgQzybwBXUvyliGAvUVGA9uW0e6U10UlbZjB65Dp_3D1SSCMSkEue9LPbyfXwg/s1600/Create+Menu+Bar+Like+Office+style+Menu.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Create Menu Bar Like Office style Menu&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7FXk4bTDM0aLECs2XZ2ZT4MBVJegv23b9KcP-iSjq8Q4rJcEB9pME8khD6IOprgq2m2l_f0bMp0_uBwgQzybwBXUvyliGAvUVGA9uW0e6U10UlbZjB65Dp_3D1SSCMSkEue9LPbyfXwg/s1600/Create+Menu+Bar+Like+Office+style+Menu.png&quot; title=&quot;Create Menu Bar Like Office style Menu&quot; /&gt;&lt;/a&gt;&lt;/div&gt;A complete ownerdraw menu class with RightToLeft support.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Add this class to your project and after designing the layout of your standard menu, use search and replace to replace &#39;System.Windows.Forms.MenuItem&#39; with &#39;MenuItemEx&#39;. You will then be able to assign colors and icons to each menu item in the project. Use this class for MDI projects or download the MenuSkinner component in the Controls section. The MenuSkinner is much simpler to use but there is a problem with Menus that unMerge which I have yet to find a solution for.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Imports System.ComponentModel
Imports System.Runtime.InteropServices
Imports System.Environment
Imports System.ComponentModel.Design
Public Class MenuitemEx
    Inherits MenuItem
#Region &quot; Windows Form Designer generated code &quot;
    Public Sub New()
        MyBase.New()
        &#39;This call is required by the Windows Form Designer.
        InitializeComponent()
        &#39;Add any initialization after the InitializeComponent() call
    End Sub
    &#39;UserControl overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub
    &#39;Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
    &#39;NOTE: The following procedure is required by the Windows Form Designer
    &#39;It can be modified using the Windows Form Designer.  
    &#39;Do not modify it using the code editor.
    &amp;lt;System.Diagnostics.DebuggerStepThrough()&amp;gt; Private Sub InitializeComponent()
        &#39;
        &#39;MenuitemEx
        &#39;
        Me.OwnerDraw = True
    End Sub
#End Region
#Region &quot; XP Related InterOp &quot;
    &amp;lt;DllImport(&quot;uxtheme.dll&quot;, CallingConvention:=CallingConvention.Cdecl)&amp;gt; _
    Private Shared Function IsAppThemed() As Boolean
    End Function
    &amp;lt;DllImport(&quot;user32.dll&quot;, CallingConvention:=CallingConvention.Cdecl)&amp;gt; _
    Private Shared Function GetSysColor(ByVal index As Integer) As Integer
    End Function
    Private Const COLOR_MENUBAR As Integer = 30
#End Region
#Region &quot; Custom Constructors &quot;
    Sub New(ByVal caption As String)
        MyClass.New(caption, Nothing)
    End Sub
    Sub New(ByVal caption As String, ByVal [image] As Image)
        MyBase.New()
        m_Image = [image]
        Me.Text = caption
    End Sub
#End Region
#Region &quot; Private Instance Variables &quot;
    Private m_Image As Image = Nothing
    Private m_ItemColors As MenuItemColors = New MenuItemColors(Me)
    Private m_Font As Font = SystemInformation.MenuFont
    Private m_HiliteStyle As HiliteStyles = HiliteStyles.Flat
    Private m_ImageIndex As Integer = -1
    Private m_Imagelist As ImageList = Nothing
    Private m_ShadowImage As Image
    Private m_IsXPThemed As Boolean = IsXPThemed
    &#39;  ________________1______________
    &#39; |    |  _________3_________     |
    &#39; |  2 | |_________4_________|    |
    &#39; |____|__________________________|
    Private m_ItemRect As Rectangle     &#39;1
    Private m_ImageRect As Rectangle    &#39;2
    Private m_BackRect As Rectangle     &#39;3
    Private m_TextRect As Rectangle     &#39;4
#End Region
#Region &quot; Custom Enum &quot;
    Public Enum HiliteStyles
        [Flat]
        [Shadow]
        [Box]
    End Enum
#End Region
#Region &quot; Properties &quot;
    &#39;Image
    &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(GetType(Image), Nothing)&amp;gt; _
    Public Property Image() As Image
        Get
            If IsNothing(m_Imagelist) = False Then
                If m_ImageIndex &amp;gt; -1 Then
                    Return m_Imagelist.Images(m_ImageIndex)
                End If
            End If
            Return m_Image
        End Get
        Set(ByVal Value As Image)
            m_Image = Value
        End Set
    End Property
    &#39;ImageList
    &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(GetType(ImageList), Nothing)&amp;gt; _
    Public Property ImageList() As ImageList
        Get
            Return m_Imagelist
        End Get
        Set(ByVal Value As ImageList)
            m_Imagelist = Value
        End Set
    End Property
    &#39;ImageIndex
    &amp;lt;Category(&quot;Appearance&quot;), DefaultValue(-1), _
    TypeConverter(GetType(ImageIndexConverter)), _
    Editor(&quot;System.Windows.Forms.Design.ImageIndexEditor, System.Design&quot;, GetType(System.Drawing.Design.UITypeEditor))&amp;gt; _
    Public Property ImageIndex() As Integer
        Get
            If m_Imagelist Is Nothing Then
                m_ImageIndex = -1
            End If
            Return m_ImageIndex
        End Get
        Set(ByVal Value As Integer)
            m_ImageIndex = Value
        End Set
    End Property
    &#39;ItemColors
    &amp;lt;Category(&quot;Appearance&quot;), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)&amp;gt; _
    Public Property ItemColors() As MenuItemColors
        Get
            Return m_ItemColors
        End Get
        Set(ByVal Value As MenuItemColors)
            m_ItemColors = Value
        End Set
    End Property
    &#39;Font
    &amp;lt;Category(&quot;Appearance&quot;), _
    Description(&quot;The Font that displays in this MenuItem.&quot;)&amp;gt; _
    Public Property Font() As Font
        Get
            Return m_Font
        End Get
        Set(ByVal Value As Font)
            If Not m_Font.Equals(Value) Then
                If IsNothing(Value) Then
                    ResetFont()
                Else
                    m_Font = Value
                End If
            End If
        End Set
    End Property
    Private Function ShouldSerializeFont() As Boolean
        Return Not (m_Font.Equals(SystemInformation.MenuFont))
    End Function
    Private Sub ResetFont()
        m_Font = SystemInformation.MenuFont
    End Sub
    &#39;HiliteStyle
    &amp;lt;Category(&quot;Behavior&quot;), DefaultValue(GetType(HiliteStyles), &quot;Flat&quot;)&amp;gt; _
    Public Property HiliteStyle() As HiliteStyles
        Get
            Return m_HiliteStyle
        End Get
        Set(ByVal Value As HiliteStyles)
            m_HiliteStyle = Value
        End Set
    End Property
    Private ReadOnly Property IsXPThemed() As Boolean
        Get
            If OSVersion.Version.Major &amp;gt;= 5 And OSVersion.Version.Minor &amp;gt;= 1 Then
                Return IsAppThemed()
            End If
        End Get
    End Property
    Private ReadOnly Property RTLMenu() As Boolean
        Get
            If IsNothing(Me.GetContextMenu) Then
                Return CBool(Me.GetMainMenu.RightToLeft)
            Else
                Return CBool(Me.GetContextMenu.RightToLeft)
            End If
        End Get
    End Property
#End Region
#Region &quot; Expandable Object Convertor &quot;
    &#39;MenuItemColors
    &amp;lt;TypeConverter(GetType(MenuItemColorsStringConverter))&amp;gt; _
    Public Class MenuItemColors
        Public Sub New(ByVal parent As MenuitemEx)
            owner = Parent
        End Sub
        Private Owner As MenuitemEx = Nothing
        Private m_StartColor As Color = Color.Ivory
        Private m_EndColor As Color = Color.PowderBlue
        Private m_ImageBarColor As Color = Color.PowderBlue
        Private m_HiliteColor As Color = Color.Moccasin
        Private m_HiliteBorderColor As Color = Color.Coral
        Private m_ForeColor As Color = Color.OrangeRed
        &#39;GradientStartColor
        &amp;lt;DefaultValue(GetType(Color), &quot;Ivory&quot;)&amp;gt; _
        Public Property GradientStartColor() As Color
            Get
                Return m_StartColor
            End Get
            Set(ByVal Value As Color)
                m_StartColor = Value
                updateProperties()
            End Set
        End Property
        &#39;GradientEndColor
        &amp;lt;DefaultValue(GetType(Color), &quot;PowderBlue&quot;)&amp;gt; _
        Public Property GradientEndColor() As Color
            Get
                Return m_EndColor
            End Get
            Set(ByVal Value As Color)
                m_EndColor = Value
                updateProperties()
            End Set
        End Property
        &#39;ImageBarColor
        &amp;lt;DefaultValue(GetType(Color), &quot;PowderBlue&quot;)&amp;gt; _
        Public Property ImageBarColor() As Color
            Get
                Return m_ImageBarColor
            End Get
            Set(ByVal Value As Color)
                m_ImageBarColor = Value
                updateProperties()
            End Set
        End Property
        &#39;HiliteColor
        &amp;lt;DefaultValue(GetType(Color), &quot;Moccasin&quot;)&amp;gt; _
        Public Property HiliteColor() As Color
            Get
                Return m_HiliteColor
            End Get
            Set(ByVal Value As Color)
                m_HiliteColor = Value
                updateProperties()
            End Set
        End Property
        &#39;HiliteBorderColor
        &amp;lt;DefaultValue(GetType(Color), &quot;Coral&quot;)&amp;gt; _
        Public Property HiliteBorderColor() As Color
            Get
                Return m_HiliteBorderColor
            End Get
            Set(ByVal Value As Color)
                m_HiliteBorderColor = Value
                updateProperties()
            End Set
        End Property
        &#39;ForeColor
        &amp;lt;DefaultValue(GetType(Color), &quot;OrangeRed&quot;)&amp;gt; _
        Public Property ForeColor() As Color
            Get
                Return m_ForeColor
            End Get
            Set(ByVal Value As Color)
                m_ForeColor = Value
                updateProperties()
            End Set
        End Property
        &#39;This method is necessary for the property to be deserialized 
        &#39;upon reset, and caused me the biggest headache.
        Sub updateProperties()
            If Owner Is Nothing Then Return
            Dim ccs As IComponentChangeService = CType(Owner.GetService(GetType(IComponentChangeService)), IComponentChangeService)
            If ccs Is Nothing Then Return
            ccs.OnComponentChanged(Owner.ItemColors, Nothing, Nothing, Nothing)
        End Sub
    End Class
    &#39;MenuItemColorStringConvertor
    Friend Class MenuItemColorsStringConverter
        Inherits ExpandableObjectConverter
        Public Overloads Overrides Function ConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal culture As System.Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As System.Type) As Object
            If destinationType Is GetType(String) Then
                Return &quot;MenuItem Colors&quot;
            End If
            Return MyBase.ConvertTo(context, culture, value, destinationType)
        End Function
        Public Overloads Overrides Function GetPropertiesSupported(ByVal context As System.ComponentModel.ITypeDescriptorContext) As Boolean
            Return True
        End Function
        Public Overloads Overrides Function GetProperties(ByVal context As System.ComponentModel.ITypeDescriptorContext, ByVal value As Object, ByVal attributes() As System.Attribute) As System.ComponentModel.PropertyDescriptorCollection
            If context.PropertyDescriptor.PropertyType.Name.Equals(&quot;MenuItemColors&quot;) Then
                Dim PropertyDescriptorCollection As System.ComponentModel.PropertyDescriptorCollection
                Dim propNames(5) As String
                PropertyDescriptorCollection = TypeDescriptor.GetProperties(GetType(MenuItemColors), attributes)
                propNames(0) = &quot;ImageBarColor&quot;
                propNames(1) = &quot;GradientStartColor&quot;
                propNames(2) = &quot;GradientEndColor&quot;
                propNames(3) = &quot;HiliteColor&quot;
                propNames(4) = &quot;HiliteBorderColor&quot;
                propNames(5) = &quot;ForeColor&quot;
                Return PropertyDescriptorCollection.Sort(propNames)
            End If
            Return MyBase.GetProperties(context, value, attributes)
        End Function
    End Class
#End Region
    Protected Overrides Sub OnMeasureItem(ByVal e As System.Windows.Forms.MeasureItemEventArgs)
        Dim ItemText As String = Text
        If ShowShortcut AndAlso Shortcut &amp;lt;&amp;gt; Shortcut.None Then
            Dim k As Keys = CType(Shortcut, Keys)
            ItemText += &quot;  &quot; + TypeDescriptor.GetConverter(GetType(Keys)).ConvertToString(k)
        End If
        Dim sf As New StringFormat(StringFormatFlags.MeasureTrailingSpaces)
        sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide
        e.ItemWidth = CInt(e.Graphics.MeasureString(ItemText, m_Font, SizeF.Empty, sf).Width)
        If Me.Text = &quot;-&quot; Then
            e.ItemHeight = 3
        ElseIf Not TypeOf Me.Parent Is MainMenu Then
            e.ItemHeight = 22
            e.ItemWidth += 44
        End If
    End Sub
    Protected Overrides Sub OnDrawItem(ByVal e As System.Windows.Forms.DrawItemEventArgs)
        m_ItemRect = e.Bounds
        m_ImageRect = New Rectangle(e.Bounds.Location, New Size(24, e.Bounds.Height))
        m_BackRect = New Rectangle(e.Bounds.Left + 24, e.Bounds.Top, e.Bounds.Width - 24, e.Bounds.Height)
        m_TextRect = New Rectangle(e.Bounds.Left + 34, e.Bounds.Top, e.Bounds.Width - 52, e.Bounds.Height)
        If RTLMenu Then
            m_ImageRect.Offset(e.Bounds.Width - 24, 0)
            m_BackRect.Offset(-24, 0)
            m_TextRect.Offset(-14, 0)
        End If
        If Text = &quot;-&quot; Then
            DrawSideBar(e.Graphics)
            DrawBackground(e.Graphics)
            DrawSeparator(e.Graphics)
        ElseIf Not TypeOf Me.Parent Is MainMenu Then
            DrawSideBar(e.Graphics)
            DrawBackground(e.Graphics)
            If CBool(e.State And DrawItemState.Selected) Then DrawHilite(e.Graphics)
            DrawImage(e.Graphics, CBool(e.State And DrawItemState.Selected) And (m_HiliteStyle = HiliteStyles.Shadow))
            DrawText(e.Graphics, Not CBool(e.State And DrawItemState.NoAccelerator))
        Else
            m_TextRect = e.Bounds
            DrawMenuBar(e.Graphics)
            If CBool(e.State And DrawItemState.Selected) OrElse _
               CBool(e.State And DrawItemState.HotLight) Then
                DrawHilite(e.Graphics)
            End If
            DrawText(e.Graphics, Not CBool(e.State And DrawItemState.NoAccelerator))
        End If
    End Sub
#Region &quot; Custom Methods &quot;
    Sub DrawMenuBar(ByVal g As Graphics)
        Dim FillBrush As New SolidBrush(SystemColors.Menu)
        If m_IsXPThemed Then
            FillBrush.Color = ColorTranslator.FromOle(GetSysColor(COLOR_MENUBAR))
        End If
        g.FillRectangle(FillBrush, m_ItemRect)
        FillBrush.Dispose()
    End Sub
    Sub DrawSeparator(ByVal g As Graphics)
        Dim DrawingPen As New Pen(m_ItemColors.ForeColor)
        Dim startpoint As New Point(m_TextRect.Left, m_TextRect.Top + 1)
        Dim endpoint As New Point(m_BackRect.Right - 1, m_BackRect.Top + 1)
        If RTLMenu Then
            startpoint.Offset(-20, 0)
            endpoint.Offset(-10, 0)
        End If
        g.DrawLine(DrawingPen, startpoint, endpoint)
        DrawingPen.Dispose()
    End Sub
    Sub DrawSideBar(ByVal g As Graphics)
        Dim DrawingBrush As New SolidBrush(m_ItemColors.ImageBarColor)
        g.FillRectangle(DrawingBrush, m_ImageRect)
        DrawingBrush.Dispose()
    End Sub
    Sub DrawBackground(ByVal g As Graphics)
        Dim FillBrush As Brush
        If RTLMenu Then
            FillBrush = New Drawing2D.LinearGradientBrush(m_BackRect, m_ItemColors.GradientEndColor, m_ItemColors.GradientStartColor, Drawing2D.LinearGradientMode.Horizontal)
        Else
            FillBrush = New Drawing2D.LinearGradientBrush(m_BackRect, m_ItemColors.GradientStartColor, m_ItemColors.GradientEndColor, Drawing2D.LinearGradientMode.Horizontal)
        End If
        g.FillRectangle(FillBrush, m_BackRect)
        FillBrush.Dispose()
    End Sub
    Sub DrawHilite(ByVal g As Graphics)
        Dim FillBrush As New SolidBrush(m_ItemColors.HiliteColor)
        Dim HiliteRect As Rectangle = m_ItemRect
        If m_HiliteStyle = HiliteStyles.Box AndAlso Not TypeOf Me.Parent Is MainMenu Then
            HiliteRect.Width -= 24
            If Not RTLMenu Then HiliteRect.Offset(24, 0)
            BoxImage(g)
        End If
        g.FillRectangle(FillBrush, HiliteRect)
        Dim BorderPen As New Pen(m_ItemColors.HiliteBorderColor)
        HiliteRect.Width -= 1
        HiliteRect.Height -= 1
        g.DrawRectangle(BorderPen, HiliteRect)
        FillBrush.Dispose()
        BorderPen.Dispose()
    End Sub
    Sub BoxImage(ByVal g As Graphics)
        If Image Is Nothing Then Return
        Dim BorderPen As New Pen(ControlPaint.LightLight(m_ItemColors.ImageBarColor))
        Dim BorderRect As Rectangle = m_ImageRect
        BorderRect.Inflate(-1, -1)
        g.DrawRectangle(BorderPen, BorderRect)
        BorderPen.Color = ControlPaint.Dark(m_ItemColors.ImageBarColor)
        g.DrawLine(BorderPen, BorderRect.Right - 1, BorderRect.Top, BorderRect.Right - 1, BorderRect.Bottom)
        g.DrawLine(BorderPen, BorderRect.Left, BorderRect.Bottom, BorderRect.Right - 1, BorderRect.Bottom)
        BorderPen.Dispose()
    End Sub
    Sub DrawText(ByVal g As Graphics, ByVal ShowHotKey As Boolean)
        Dim TextBrush As New SolidBrush(m_ItemColors.ForeColor)
        Dim sf As New StringFormat
        sf.LineAlignment = StringAlignment.Center
        sf.Alignment = StringAlignment.Near
        If ShowHotKey Then
            sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show
        Else
            sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide
        End If        
        Dim ShorCutText As String
        If ShowShortcut AndAlso Shortcut &amp;lt;&amp;gt; Shortcut.None Then
            Dim k As Keys = CType(Shortcut, Keys)
            ShorCutText = TypeDescriptor.GetConverter(GetType(Keys)).ConvertToString(k)
        End If
        If RTLMenu Then
            sf.FormatFlags = StringFormatFlags.DirectionRightToLeft
        End If
        If TypeOf Me.Parent Is MainMenu Then sf.Alignment = StringAlignment.Center
        If Me.Enabled Then
            g.DrawString(Text, m_Font, TextBrush, RectangleF.op_Implicit(m_TextRect), sf)
            sf.Alignment = StringAlignment.Far
            g.DrawString(ShorCutText, m_Font, TextBrush, RectangleF.op_Implicit(m_TextRect), sf)
        Else
            ControlPaint.DrawStringDisabled(g, Text, m_Font, m_ItemColors.GradientEndColor, RectangleF.op_Implicit(m_TextRect), sf)
            sf.Alignment = StringAlignment.Far
            ControlPaint.DrawStringDisabled(g, ShorCutText, m_Font, m_ItemColors.GradientEndColor, RectangleF.op_Implicit(m_TextRect), sf)
        End If
        TextBrush.Dispose()
        sf.Dispose()
    End Sub
    Sub DrawImage(ByVal g As Graphics, ByVal Shadow As Boolean)
        If Image Is Nothing Then Return
        Dim Iconrect As Rectangle = m_ImageRect
        Iconrect.Inflate(-4, -4)
        If Shadow Then
            If m_ShadowImage Is Nothing Then
                m_ShadowImage = New Bitmap(CreateShadowImage(Image))
            End If
            Iconrect.Offset(1, 1)
            g.DrawImage(m_ShadowImage, Iconrect)
            Iconrect.Offset(-2, -2)
        End If
        g.DrawImage(Image, Iconrect)
    End Sub
    Function CreateShadowImage(ByVal bmp As Image) As Bitmap
        Dim shadow As New Bitmap(bmp, 16, 16)
        Dim ShadowColor As Color = ControlPaint.Dark(m_ItemColors.HiliteColor)
        For x As Integer = 0 To 15
            For y As Integer = 0 To 15
                If shadow.GetPixel(x, y).A &amp;gt; 32 Then
                    shadow.SetPixel(x, y, ShadowColor)
                End If
            Next
        Next
        Return shadow
    End Function
#End Region
    &#39;didn&#39;t have to do this in C#
    Friend Shadows Function GetService(ByVal service As System.Type) As Object
        Return MyBase.GetService(service)
    End Function
End Class
&lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.ComponentModel.Design;
using System.Runtime.InteropServices;
namespace Dotnetrix_Samples
{
    /// &amp;lt;summary&amp;gt;
    /// Summary description for MenuItemEx.
    /// &amp;lt;/summary&amp;gt;
    public class MenuItemEx : System.Windows.Forms.MenuItem
    {
        /// &amp;lt;summary&amp;gt; 
        /// Required designer variable.
        /// &amp;lt;/summary&amp;gt;
        private System.ComponentModel.Container components = null;
        public MenuItemEx()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            // TODO: Add any initialization after the InitializeComponent call
            m_ItemColors = new MenuItemColors(this);    
        }

        /// &amp;lt;summary&amp;gt; 
        /// Clean up any resources being used.
        /// &amp;lt;/summary&amp;gt;
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if(components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose( disposing );
        }

        #region Component Designer generated code
        /// &amp;lt;summary&amp;gt; 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// &amp;lt;/summary&amp;gt;
        private void InitializeComponent()
        {
            // 
            // MenuItemEx
            // 
            this.OwnerDraw = true;
        }
        #endregion
        #region XP Related InterOp
        [DllImport(&quot;uxtheme.dll&quot;, CallingConvention=CallingConvention.Cdecl)]
        private static extern bool IsAppThemed();
        
        [DllImport(&quot;user32.dll&quot;, CallingConvention=CallingConvention.Cdecl)]
        private static extern int GetSysColor(int index);
        private const int COLOR_MENUBAR = 30;
        #endregion
        #region Custom Constructors
        public MenuItemEx(String caption) : this(caption,(Image)null)
        {
        }

        public MenuItemEx(String caption,Image image): base()
        {
            m_Image = image;
            this.Text = caption;
        }
        
        #endregion
        
        #region Private Instance Variables
        private Image m_Image = null;
        private MenuItemColors m_ItemColors;
        private Font m_Font = SystemInformation.MenuFont;
        private HiliteStyles m_HiliteStyle = HiliteStyles.Flat;
        private int m_ImageIndex = -1;
        private ImageList m_Imagelist = null;
        private Image m_ShadowImage = null;
        
        private bool m_IsXPThemed = IsXPThemed;
        //  ________________1______________
        // |    |  _________3_________     |
        // |  2 | |_________4_________|    |
        // |____|__________________________|
        private Rectangle m_ItemRect;   //1
        private Rectangle m_ImageRect;  //2
        private Rectangle m_BackRect;   //3
        private Rectangle m_TextRect;   //4
        #endregion
        #region Custom Enum
        public enum HiliteStyles
        {
            Flat,
            Shadow,
            Box
        }

        #endregion
        #region Properties
        //Image
        [Category(&quot;Appearance&quot;), DefaultValue(typeof(Image), null)]
        public Image image
        {
            get
            {
                if (m_Imagelist != null)
                {
                    if (m_ImageIndex &amp;gt; -1)
                        return m_Imagelist.Images[m_ImageIndex];
                }
                return m_Image;
            }
            set
            {
                m_Image = value;
            }
        }

        //ImageList
        [Category(&quot;Appearance&quot;), DefaultValue(typeof(ImageList), null)]
        public ImageList imageList
        {
            get
            {
                return m_Imagelist;
            }
            set
            {
                m_Imagelist = value;
            }
        }

        //ImageIndex
        [Category(&quot;Appearance&quot;), DefaultValue(-1), TypeConverter(typeof(ImageIndexConverter)),
        Editor(&quot;System.Windows.Forms.Design.ImageIndexEditor, System.Design&quot;, typeof(System.Drawing.Design.UITypeEditor))]
        public int ImageIndex
        {
            get
            {
                if (m_Imagelist == null)
                    m_ImageIndex = -1;
                return m_ImageIndex;
            }
            set
            {
                m_ImageIndex = value;
            }
        }

        //ItemColors
        [Category(&quot;Appearance&quot;), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [RefreshProperties(RefreshProperties.All)]
        public MenuItemColors ItemColors
        {
            get
            {
                return m_ItemColors;
            }
            set
            {
                m_ItemColors = value;
            }
        }

        //Font
        [Category(&quot;Appearance&quot;),Description(&quot;The Font that displays in this MenuItem.&quot;)]
        public Font font
        {
            get
            {
                return m_Font;
            }
            set
            {
                if (!m_Font.Equals(value))
                {
                    if (value != null)
                        ResetFont();
                    else
                        m_Font = value;
                }
            }
        }
        private bool ShouldSerializeFont()
        {
            return !m_Font.Equals(SystemInformation.MenuFont);
        }
        private void ResetFont()
        {
            m_Font = SystemInformation.MenuFont;
        }

        //HiliteStyle
        [Category(&quot;Behavior&quot;), DefaultValue(typeof(HiliteStyles), &quot;Flat&quot;)]
        public HiliteStyles HiliteStyle 
        {
            get
            {
                return m_HiliteStyle;
            }
            set
            {
                m_HiliteStyle = value;
            }
        }

        private static bool IsXPThemed
        {
            get
            {
                if (Environment.OSVersion.Version.Major &amp;gt;= 5 &amp;amp;&amp;amp; Environment.OSVersion.Version.Minor &amp;gt;= 1)
                    return IsAppThemed();
                return false;
            }
        }

        private bool RTLMenu
        {
            get
            {
                if (GetContextMenu() == null)                    
                    return (bool)(GetMainMenu().RightToLeft == RightToLeft.Yes);
                else
                    return (bool)(GetContextMenu().RightToLeft == RightToLeft.Yes);
                
            }
        }

        #endregion
        #region Expandable Object Convertor
        //MenuItemColors
        [TypeConverter(typeof(MenuItemColorsStringConverter))]
            public class MenuItemColors
        {
            public MenuItemColors(MenuItemEx parent) : base()
            {
                owner = parent;
            }
            private MenuItemEx owner;
            private Color m_StartColor = Color.Ivory;
            private Color m_EndColor = Color.PowderBlue;
            private Color m_ImageBarColor = Color.PowderBlue;
            private Color m_HiliteColor = Color.Moccasin;
            private Color m_HiliteBorderColor = Color.Coral;
            private Color m_ForeColor = Color.OrangeRed;
            //GradientStartColor
            [DefaultValue(typeof(Color), &quot;Ivory&quot;)]
            public Color GradientStartColor
            {
                get
                {
                    return m_StartColor;
                }
                set
                {
                    m_StartColor = value;
                    updateProperties();
                }
            }
    
            //GradientEndColor
            [DefaultValue(typeof(Color), &quot;PowderBlue&quot;)]
            public Color GradientEndColor
            {
                get
                {
                    return m_EndColor;
                }
                set
                {
                    m_EndColor = value;
                    updateProperties();
                }
            }
            
            //ImageBarColor
            [DefaultValue(typeof(Color), &quot;PowderBlue&quot;)]
            public Color ImageBarColor
            {
                get
                {
                    return m_ImageBarColor;
                }
                set
                {
                    m_ImageBarColor = value;
                    updateProperties();
                }
            }

            //HiliteColor
            [DefaultValue(typeof(Color), &quot;Moccasin&quot;)]
            public Color HiliteColor
            {
                get
                {
                    return m_HiliteColor;
                }
                set
                {
                    m_HiliteColor = value;
                    updateProperties();
                }
            }

            //HiliteBorderColor
            [DefaultValue(typeof(Color), &quot;Coral&quot;)]
            public Color HiliteBorderColor
            {
                get
                {
                    return m_HiliteBorderColor;
                }
                set
                {
                    m_HiliteBorderColor = value;
                    updateProperties();
                }
            }

            //ForeColor
            [DefaultValue(typeof(Color), &quot;OrangeRed&quot;)]
            public Color ForeColor
            {
                get
                {
                    return m_ForeColor;
                }
                set
                {
                    m_ForeColor = value;
                    updateProperties();
                }
            }

            //This method is necessary for the property to be deserialized 
            //upon reset, and caused me the biggest headache.
            void updateProperties()
            {
                if (owner == null) return;
                IComponentChangeService ccs = 
                    (IComponentChangeService)
                    owner.GetService(typeof(IComponentChangeService));
                if (ccs == null) return;
                ccs.OnComponentChanged(owner.ItemColors, null, null, null);
                
            }

        }

        //MenuItemColorStringConvertor
        internal class MenuItemColorsStringConverter : ExpandableObjectConverter
        {
            public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
            {
                return false;
            }
 
            public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
            {
                if (destinationType == typeof(string) &amp;amp;&amp;amp; value is MenuItemColors)
                    return &quot;MenuItem Colors&quot;;
                return base.ConvertTo (context, culture, value, destinationType);
            }
            
        
            public override bool GetPropertiesSupported(ITypeDescriptorContext context)
            {
                return true;
            }

            public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) 
            {
                if (context.PropertyDescriptor.PropertyType.Name.Equals(&quot;MenuItemColors&quot;))
                {
                    System.ComponentModel.PropertyDescriptorCollection propertyDescriptorCollection; 
                    string[] propNames = new string[5]; 
                    propertyDescriptorCollection = TypeDescriptor.GetProperties(typeof(MenuItemColors),attributes); 
                    propNames[0] = @&quot;ImageBarColor&quot;; 
                    propNames[1] = @&quot;GradientStartColor&quot;;
                    propNames[2] = @&quot;GradientEndColor&quot;;
                    propNames[3] = @&quot;HiliteColor&quot;;
                    propNames[4] = @&quot;HiliteBorderColor&quot;;
                    //for some reason setting the last element stops the Property
                    //expanding in C# but not in VB. Not that it matters since
                    //it&#39;s the only property left and so will be auto sorted.
                    //propNames[5] = @&quot;ForeColor&quot;;
                    return propertyDescriptorCollection.Sort(propNames); 
                }
                return base.GetProperties(context, value, attributes);
            } 
 
        }

        #endregion
        
        protected override void OnMeasureItem(MeasureItemEventArgs e)
        {
            String ItemText = Text;
            if (ShowShortcut &amp;amp;&amp;amp; Shortcut != Shortcut.None)
            {
                Keys k = (Keys)Shortcut;
                ItemText += &quot;  &quot; + TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(k);
            }
            
            StringFormat sf = new StringFormat(StringFormatFlags.MeasureTrailingSpaces);
            sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide;
            
            e.ItemWidth = (int)e.Graphics.MeasureString(ItemText, m_Font, SizeF.Empty, sf).Width;
            
            if (Text == &quot;-&quot;)
                e.ItemHeight = 3;
            else if (this.Parent is MainMenu == false)
            {
                e.ItemHeight = 22;
                e.ItemWidth += 44;
            }
        }

        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            m_ItemRect = e.Bounds;
            m_ImageRect = new Rectangle(e.Bounds.Location, new Size(24, e.Bounds.Height));
            m_BackRect = new Rectangle(e.Bounds.Left + 24, e.Bounds.Top, e.Bounds.Width - 24, e.Bounds.Height);
            m_TextRect = new Rectangle(e.Bounds.Left + 34, e.Bounds.Top, e.Bounds.Width - 52, e.Bounds.Height);
            if (RTLMenu)
            {
                m_ImageRect.Offset(e.Bounds.Width - 24, 0);
                m_BackRect.Offset(-24, 0);
                m_TextRect.Offset(-14, 0);
            }
            
            if (Text == &quot;-&quot;)
            {
                DrawSideBar(e.Graphics);
                DrawBackground(e.Graphics);
                DrawSeparator(e.Graphics);
            }
            else if(Parent is MainMenu == false)
            {
                DrawSideBar(e.Graphics);
                DrawBackground(e.Graphics);
                if (System.Convert.ToBoolean(e.State &amp;amp; DrawItemState.Selected)) 
                    DrawHilite(e.Graphics);
                DrawImage(e.Graphics, ((System.Convert.ToBoolean(e.State &amp;amp; DrawItemState.Selected) &amp;amp;&amp;amp; (m_HiliteStyle == HiliteStyles.Shadow))));
                DrawText(e.Graphics, !System.Convert.ToBoolean(e.State &amp;amp; DrawItemState.NoAccelerator));
            }
            else
            {
                m_TextRect = e.Bounds;
                DrawMenuBar(e.Graphics);
                if (System.Convert.ToBoolean(e.State &amp;amp; DrawItemState.Selected) || System.Convert.ToBoolean(e.State &amp;amp; DrawItemState.HotLight)) 
                    DrawHilite(e.Graphics);
                DrawText(e.Graphics, !System.Convert.ToBoolean(e.State &amp;amp; DrawItemState.NoAccelerator));
            }
            
        }

        #region Custom Methods
        void DrawMenuBar(Graphics g)
        {
            SolidBrush FillBrush = new SolidBrush(SystemColors.Menu);
            if (m_IsXPThemed)
                FillBrush.Color = ColorTranslator.FromOle(GetSysColor(COLOR_MENUBAR));
            g.FillRectangle(FillBrush, m_ItemRect);
            FillBrush.Dispose();
        }
        
        void DrawSeparator(Graphics g)
        {
            Pen DrawingPen = new Pen(m_ItemColors.ForeColor);
            Point startpoint = new Point(m_TextRect.Left, m_TextRect.Top + 1);
            Point endpoint = new Point(m_BackRect.Right - 1, m_BackRect.Top + 1);
            if (RTLMenu)
            {
                startpoint.Offset(-20, 0);
                endpoint.Offset(-10, 0);
            }
            g.DrawLine(DrawingPen, startpoint, endpoint);
            DrawingPen.Dispose();
        }

        void DrawSideBar(Graphics g)
        {
            SolidBrush DrawingBrush = new SolidBrush(m_ItemColors.ImageBarColor);
            g.FillRectangle(DrawingBrush, m_ImageRect);
            DrawingBrush.Dispose();
        }

        void DrawBackground(Graphics g)
        {
            Brush FillBrush;
            if (RTLMenu)
                FillBrush = new LinearGradientBrush(m_BackRect, m_ItemColors.GradientEndColor, m_ItemColors.GradientStartColor, LinearGradientMode.Horizontal);
            else
                FillBrush = new LinearGradientBrush(m_BackRect, m_ItemColors.GradientStartColor, m_ItemColors.GradientEndColor, LinearGradientMode.Horizontal);
            g.FillRectangle(FillBrush, m_BackRect);
            FillBrush.Dispose();
        }

        void DrawHilite(Graphics g)
        {
            SolidBrush FillBrush = new SolidBrush(m_ItemColors.HiliteColor);
            Rectangle HiliteRect = m_ItemRect;
            if (m_HiliteStyle == HiliteStyles.Box &amp;amp;&amp;amp; Parent is MainMenu == false)
            {
                HiliteRect.Width -= 24;
                if (!RTLMenu)
                    HiliteRect.Offset(24, 0);
                BoxImage(g);
            }
            g.FillRectangle(FillBrush, HiliteRect);
            Pen BorderPen = new Pen(m_ItemColors.HiliteBorderColor);
            HiliteRect.Width -= 1;
            HiliteRect.Height -= 1;
            g.DrawRectangle(BorderPen, HiliteRect);
            FillBrush.Dispose();
            BorderPen.Dispose();
        }
        
        void BoxImage(Graphics g)
        {
            if (image == null) return;
            Pen BorderPen = new Pen(ControlPaint.LightLight(m_ItemColors.ImageBarColor));
            Rectangle BorderRect = m_ImageRect;
            BorderRect.Inflate(-1, -1);
            g.DrawRectangle(BorderPen, BorderRect);
            BorderPen.Color = ControlPaint.Dark(m_ItemColors.ImageBarColor);
            g.DrawLine(BorderPen, BorderRect.Right - 1, BorderRect.Top, BorderRect.Right - 1, BorderRect.Bottom);
            g.DrawLine(BorderPen, BorderRect.Left, BorderRect.Bottom, BorderRect.Right - 1, BorderRect.Bottom);
            BorderPen.Dispose();
        }

            void DrawText(Graphics g, bool ShowHotKey)
            {
                SolidBrush TextBrush = new SolidBrush(m_ItemColors.ForeColor);
                StringFormat sf = new StringFormat();
                sf.LineAlignment = StringAlignment.Center;
                sf.Alignment = StringAlignment.Near;
                if (ShowHotKey)
                    sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;
                else
                    sf.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Hide;
            
                String ShorCutText = &quot;&quot;;
            
                if (ShowShortcut &amp;amp;&amp;amp; Shortcut != Shortcut.None)
                {
                    Keys k = (Keys)Shortcut;
                    ShorCutText = TypeDescriptor.GetConverter(typeof(Keys)).ConvertToString(k);
                }
            
                if (RTLMenu)
                    sf.FormatFlags = StringFormatFlags.DirectionRightToLeft;
            
                if (Parent is MainMenu)
                    sf.Alignment = StringAlignment.Center;
            
                if (Enabled)
                {
                    g.DrawString(Text, m_Font, TextBrush, RectangleF.op_Implicit(m_TextRect), sf);
                    sf.Alignment = StringAlignment.Far;
                    g.DrawString(ShorCutText, m_Font, TextBrush, RectangleF.op_Implicit(m_TextRect), sf);
                }
                else
                {
                    ControlPaint.DrawStringDisabled(g, Text, m_Font, m_ItemColors.GradientEndColor, RectangleF.op_Implicit(m_TextRect), sf);
                    sf.Alignment = StringAlignment.Far;
                    ControlPaint.DrawStringDisabled(g, ShorCutText, m_Font, m_ItemColors.GradientEndColor, RectangleF.op_Implicit(m_TextRect), sf);
                }
            
                TextBrush.Dispose();
                sf.Dispose();
            
            }

        void DrawImage(Graphics g, bool Shadow)
        {
            if (image == null) return;
            Rectangle Iconrect = m_ImageRect;
            Iconrect.Inflate(-4, -4);
            
            if (Shadow)
            {
                if (m_ShadowImage == null)
                    m_ShadowImage = new Bitmap(CreateShadowImage(image));
                Iconrect.Offset(1, 1);
                g.DrawImage(m_ShadowImage, Iconrect);
                Iconrect.Offset(-2, -2);
            }
            g.DrawImage(image, Iconrect);
            
        }

        Bitmap CreateShadowImage(Image bmp)
        {
            Bitmap shadow = new Bitmap(bmp, 16, 16);
            Color ShadowColor = ControlPaint.Dark(m_ItemColors.HiliteColor);
            
            for (int x = 0; x&amp;lt;=15; x++)
            {
                for (int y = 0;  y&amp;lt;=15; y++)
                {
                    if (shadow.GetPixel(x, y).A &amp;gt; 32)
                        shadow.SetPixel(x, y, ShadowColor);
                }
            }
            
            return shadow;
            
        }

        #endregion
    }
}
                    &lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/1445555717993805236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/create-menu-bar-like-office-style-menu.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1445555717993805236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/1445555717993805236'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/create-menu-bar-like-office-style-menu.html' title='Create Menu Bar Like Office style Menu'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7FXk4bTDM0aLECs2XZ2ZT4MBVJegv23b9KcP-iSjq8Q4rJcEB9pME8khD6IOprgq2m2l_f0bMp0_uBwgQzybwBXUvyliGAvUVGA9uW0e6U10UlbZjB65Dp_3D1SSCMSkEue9LPbyfXwg/s72-c/Create+Menu+Bar+Like+Office+style+Menu.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-9068639995368854653</id><published>2011-07-22T10:21:00.000-07:00</published><updated>2011-07-22T10:21:31.695-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Menu Strip"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>Add Menu Items on Top Left Window Icon (AKA System Menu)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwYN_dCUP0ckLDWBHlzbbRuzJXcSNyt4H13_qgSUSNPrang6IRkTgc4FLXODTgEkz2q0bFyFjoEYZWxUYg7hddBW-A_3o7l3rLI0tpOFnGf6AJeNpYcEKCby09ZGtR9BdygslcLu2ynJ4/s1600/Adding+Menu+Items+on+Top+Left+Window+Icon.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Add Menu Items on Top Left Window Icon&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwYN_dCUP0ckLDWBHlzbbRuzJXcSNyt4H13_qgSUSNPrang6IRkTgc4FLXODTgEkz2q0bFyFjoEYZWxUYg7hddBW-A_3o7l3rLI0tpOFnGf6AJeNpYcEKCby09ZGtR9BdygslcLu2ynJ4/s1600/Adding+Menu+Items+on+Top+Left+Window+Icon.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;There is no DotNet Native way to manipulate the Window Menu. You must do it all via InterOp.&lt;br /&gt;
You can add existing Menuitems though.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
The instructions shown here detail the steps necessary to achieve the menu as shown above.&lt;br /&gt;
&lt;h3&gt;VB net Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;&#39;Create a New Windows Form Project.
&#39;Add the following line of code before Public Class Form1:
&#39;  Imports System.Runtime.InteropServices
&#39;Add a ContextMenu to the Form and name it PopUpMenu.
&#39;Add a MenuItem to PopUpMenu and call it sysPopUp.
&#39;Add a MainMenu to the form and add a MenuItem to that which you should name MenuHelpAbout.
&#39;Finally, Add the following code to the Form.

&amp;lt;DllImport(&quot;user32.dll&quot;, CallingConvention:=CallingConvention.Cdecl)&amp;gt; _
Private Shared Function GetSystemMenu(ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr
End Function

&amp;lt;DllImport(&quot;user32.dll&quot;, CallingConvention:=CallingConvention.Cdecl)&amp;gt; _
Private Shared Function AppendMenu(ByVal hMenu As IntPtr, ByVal uFlags As Int32, ByVal uIDNewItem As IntPtr, ByVal lpNewItem As String) As Boolean
End Function

&amp;lt;DllImport(&quot;user32&quot;, CallingConvention:=CallingConvention.Cdecl)&amp;gt; _
Private Shared Function InsertMenu(ByVal hMenu As IntPtr, ByVal uPosition As Integer, ByVal uFlags As Integer, ByVal uIDNewItem As IntPtr, ByVal lpNewItem As String) As Boolean
End Function

&amp;lt;DllImport(&quot;user32&quot;, CallingConvention:=CallingConvention.Cdecl)&amp;gt; _
Private Shared Function SetMenuItemBitmaps(ByVal hMenu As IntPtr, ByVal uPosition As Integer, ByVal uFlags As Integer, ByVal hBitmapUnchecked As IntPtr, ByVal hBitmapChecked As IntPtr) As Boolean
End Function

Private Const MF_STRING As Integer = &amp;amp;H0
Private Const MF_SEPARATOR As Integer = &amp;amp;H800&amp;amp;
Private Const MF_BYCOMMAND As Integer = &amp;amp;H0
Private Const MF_BYPOSITION As Integer = &amp;amp;H400
Private Const MF_POPUP As Integer = &amp;amp;H10

Private Const WM_SYSCOMMAND As Integer = &amp;amp;H112

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AddSysMenuItems()
End Sub

Private Sub AddSysMenuItems()

    &#39;Create a glyph for About MenuItem
    Dim bmpGlyph As New Bitmap(16, 16)
    Dim g As Graphics = Graphics.FromImage(bmpGlyph)
    g.Clear(Color.White)
    Dim sf As New StringFormat
    sf.LineAlignment = StringAlignment.Center
    sf.Alignment = StringAlignment.Center
    g.DrawString(&quot;?&quot;, New Font(FontFamily.GenericMonospace, 16, FontStyle.Bold, GraphicsUnit.Pixel), SystemBrushes.WindowText, New RectangleF(0, 0, 16, 16), sf)
    g.Dispose()

    &#39;Get a gdi bitmap object from our bitmap.
    Dim hbmp As IntPtr = bmpGlyph.GetHbitmap
    bmpGlyph.Dispose()

    &#39;Get the System Menus Handle.
    Dim hSysMenu As IntPtr = GetSystemMenu(Me.Handle, False)

    &#39;Add a standard Separator Item.
    AppendMenu(hSysMenu, MF_SEPARATOR, IntPtr.Zero, Nothing)
    &#39;Add an About Menu Item.
    AppendMenu(hSysMenu, MF_STRING, MenuHelpAbout.Handle, MenuHelpAbout.Text)
    &#39;Add our Glyph to the About MenuItem.
    SetMenuItemBitmaps(hSysMenu, MenuHelpAbout.Handle.ToInt32, MF_BYCOMMAND, hbmp, hbmp)
    &#39;Finally we&#39;ll insert an existing Popup Menu at position 0
    InsertMenu(hSysMenu, 0, MF_BYPOSITION Or MF_POPUP, PopupMenu.Handle, &quot;Popup Item&quot;)
    &#39;and a separator at position 1.
    InsertMenu(hSysMenu, 1, MF_BYPOSITION Or MF_SEPARATOR, IntPtr.Zero, Nothing)

End Sub

Private Sub MenuHelpAbout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuHelpAbout.Click
    Dim id As String
    If TypeOf sender Is Menu Then
        id = &quot;Forms&quot;
    Else
        id = &quot;Window Menus&quot;
    End If
    MessageBox.Show(String.Format(&quot;This message was initiated from the {0} About Menu&quot;, id))
End Sub

Private Sub sysPopUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sysPopUp.Click
    MessageBox.Show(DirectCast(sender, MenuItem).Text)
End Sub

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
    &#39;MenuItems added directly to the System menu do not fire the 
    &#39;Menuitems default event, so we need to call this ourselves.
    &#39;Popupmenus will fire their default events though as can be
    &#39;seen by the fact that we do not call sysPopUp_Click() here.
    MyBase.WndProc(m)
    If m.Msg = WM_SYSCOMMAND Then
        If m.WParam.Equals(MenuHelpAbout.Handle) Then
            MenuHelpAbout_Click(Me, EventArgs.Empty)
        End If
    End If

End Sub
                    &lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Sample:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;//Create a New Windows Form Project.
//Add the following line of code before public class form1:
//  using System.Runtime.InteropServices;
//Add a ContextMenu to the Form and name it PopUpMenu.
//Add a MenuItem to PopUpMenu and call it sysPopUp.
//Add a MainMenu to the form and add a MenuItem to that which you should name MenuHelpAbout.
//Finally, Add the following code to the Form.
[DllImport(&amp;quot;user32.dll&amp;quot;, CallingConvention=CallingConvention.Cdecl)]
private static extern IntPtr GetSystemMenu(IntPtr hWnd , bool bRevert);
    
[DllImport(&amp;quot;user32.dll&amp;quot;, CallingConvention=CallingConvention.Cdecl)]
private static extern bool AppendMenu(IntPtr hMenu, Int32 uFlags, IntPtr uIDNewItem, String lpNewItem );
    
[DllImport(&amp;quot;user32&amp;quot;, CallingConvention=CallingConvention.Cdecl)]
private static extern bool InsertMenu(IntPtr hMenu, int uPosition, int uFlags, IntPtr uIDNewItem, String lpNewItem);
[DllImport(&amp;quot;user32&amp;quot;, CallingConvention=CallingConvention.Cdecl)]
private static extern bool SetMenuItemBitmaps(IntPtr hMenu, int uPosition, int uFlags, IntPtr hBitmapUnchecked, IntPtr hBitmapChecked);
private const int MF_STRING  = 0;
private const int MF_SEPARATOR = 0x800;
private const int MF_BYCOMMAND = 0;
private const int MF_BYPOSITION = 0x400;
private const int MF_POPUP = 0x10;
private System.Windows.Forms.ContextMenu PopUpMenu;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem MenuHelpAbout;
private const int WM_SYSCOMMAND = 0x112;
private void Form1_Load(object sender, System.EventArgs e)
{
    AddSysMenuItems();
}

private void AddSysMenuItems()
{
    //Create a glyph for About MenuItem
    Bitmap bmpGlyph = new Bitmap(16, 16);
    Graphics g = Graphics.FromImage(bmpGlyph);
    g.Clear(Color.White);
    StringFormat sf = new StringFormat();
    sf.LineAlignment = StringAlignment.Center;
    sf.Alignment = StringAlignment.Center;
    g.DrawString(&amp;quot;?&amp;quot;, new Font(FontFamily.GenericMonospace, 16, FontStyle.Bold, GraphicsUnit.Pixel), SystemBrushes.WindowText, new RectangleF(0, 0, 16, 16), sf);
    g.Dispose();
      
    //Get a gdi bitmap object from our bitmap.
    IntPtr hbmp = bmpGlyph.GetHbitmap();
    bmpGlyph.Dispose();
        
    //Get the System Menus Handle.
    IntPtr hSysMenu = GetSystemMenu(Handle, false);
       
    //Add a standard Separator Item.
    AppendMenu(hSysMenu, MF_SEPARATOR, IntPtr.Zero, null);
    //Add an About Menu Item.
    AppendMenu(hSysMenu, MF_STRING, MenuHelpAbout.Handle, MenuHelpAbout.Text);
    //Add our Glyph to the About MenuItem.
    SetMenuItemBitmaps(hSysMenu, MenuHelpAbout.Handle.ToInt32(), MF_BYCOMMAND, hbmp, hbmp);
    //Finally we&#39;ll insert an existing Popup Menu at position 0
    InsertMenu(hSysMenu, 0, MF_BYPOSITION | MF_POPUP, PopUpMenu.Handle, &amp;quot;Popup Item&amp;quot;);
    //and a separator at position 1.
    InsertMenu(hSysMenu, 1, MF_BYPOSITION | MF_SEPARATOR, IntPtr.Zero, null);
      
}
    
#endregion
private void MenuHelpAbout_Click(object sender, System.EventArgs e)
{
    String id;
    if (sender is Menu)
        id = &amp;quot;Forms&amp;quot;;
    else
        id = &amp;quot;Window Menus&amp;quot;;
       
    MessageBox.Show(String.Format(&amp;quot;This message was initiated from the {0} About Menu&amp;quot;, id));
}

private void sysPopUp_Click(object sender, System.EventArgs e)
{
    MessageBox.Show(((MenuItem)sender).Text);
}

protected override void WndProc(ref Message m)
{
    //MenuItems added directly to the System menu do not fire the
    //Menuitems default event, so we need to call this ourselves.
    //Popupmenus will fire their default events though as can be
    //seen by the fact that we do not call sysPopUp_Click() here.
    base.WndProc (ref m);
    if (m.Msg == WM_SYSCOMMAND)
        if (m.WParam.Equals(MenuHelpAbout.Handle))
            MenuHelpAbout_Click(this, EventArgs.Empty);
}
                    &lt;/pre&gt;&lt;/div&gt;by: &lt;a href=&quot;http://dotnetrix.co.uk/&quot;&gt;Mick Dohertys&#39;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/9068639995368854653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/add-menu-items-on-top-left-window-icon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/9068639995368854653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/9068639995368854653'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/add-menu-items-on-top-left-window-icon.html' title='Add Menu Items on Top Left Window Icon (AKA System Menu)'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwYN_dCUP0ckLDWBHlzbbRuzJXcSNyt4H13_qgSUSNPrang6IRkTgc4FLXODTgEkz2q0bFyFjoEYZWxUYg7hddBW-A_3o7l3rLI0tpOFnGf6AJeNpYcEKCby09ZGtR9BdygslcLu2ynJ4/s72-c/Adding+Menu+Items+on+Top+Left+Window+Icon.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1847278434515420457.post-6661137944890948078</id><published>2011-07-22T07:59:00.000-07:00</published><updated>2011-07-22T10:07:37.355-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSharp"/><category scheme="http://www.blogger.com/atom/ns#" term="programing world"/><category scheme="http://www.blogger.com/atom/ns#" term="TabControl"/><category scheme="http://www.blogger.com/atom/ns#" term="VB.net"/><title type='text'>TabDragging Example using TabDragger Class</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Add the following classes to your project and make one of the following calls to your forms constructor after the InitializeComponent() call (assumes your TabControl is named TabControl1):&lt;br /&gt;
This will give you simple DragArrange of the tabs.&lt;br /&gt;
[VB]    Dim DragTabs As new TabDragger(TabControl1)&lt;br /&gt;
[C#]    TabDragger DragTabs = New TabDragger(this.tabControl1);&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
...and this will give you the ability to drag tabs out of the tabcontrol.&lt;br /&gt;
[VB]    Dim DragTabs As New TabDragger(TabControl1, TabDragBehavior.TabDragout)&lt;br /&gt;
[C#]    TabDragger DragTabs = new TabDragger(this.tabControl1, TabDragBehavior.TabDragOut);&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;VB net Class:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;VBcode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;VBcode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;Friend Class TabDragger

    Public Sub New(ByVal tabControl As TabControl)
        MyBase.New()
        Me.tabControl = tabControl
        AddHandler tabControl.MouseDown, AddressOf tabControl_MouseDown
        AddHandler tabControl.MouseMove, AddressOf tabControl_MouseMove
        AddHandler tabControl.DoubleClick, AddressOf tabControl_DoubleClick
    End Sub

    Public Sub New(ByVal tabControl As TabControl, ByVal behavior As TabDragBehavior)
        Me.New(tabControl)
        Me._dragBehavior = behavior
    End Sub

    Private tabControl As TabControl
    Private dragTab As TabPage = Nothing
    Private _dragBehavior As TabDragBehavior = TabDragBehavior.TabDragArrange

    Private ReadOnly Property DragBehavior() As TabDragBehavior
        Get
            If (Not tabControl.Multiline) Then
                Return _dragBehavior
            End If
            Return TabDragBehavior.None
        End Get
    End Property

    Private Sub tabControl_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
        dragTab = TabUnderMouse()
    End Sub

    Private Sub tabControl_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)

        If (_dragBehavior = TabDragBehavior.None) Then
            Return
        End If

        If (e.Button = MouseButtons.Left) Then
            If (dragTab IsNot Nothing) Then
                If (tabControl.TabPages.Contains(dragTab)) Then
                    If (PointInTabStrip(e.Location)) Then
                        Dim hotTab As TabPage = TabUnderMouse()
                        If (hotTab IsNot dragTab AndAlso hotTab IsNot Nothing) Then
                            Dim id1 As Int32 = tabControl.TabPages.IndexOf(dragTab)
                            Dim id2 As Int32 = tabControl.TabPages.IndexOf(hotTab)
                            If (id1 &amp;gt; id2) Then
                                For id As Int32 = id2 To id1
                                    SwapTabPages(id1, id)
                                Next
                            Else
                                For id As Int32 = id2 To id1 Step -1
                                    SwapTabPages(id1, id)
                                Next
                            End If
                            tabControl.SelectedTab = dragTab
                        End If
                    Else
                        If (Me._dragBehavior = TabDragBehavior.TabDragOut) Then
                            If (dragTab.Tag IsNot Nothing) Then

                                DirectCast(dragTab.Tag, TabForm).Dispose()
                                dragTab.Tag = Nothing
                            Else
                                Dim frm As New TabForm(dragTab)
                            End If
                        End If
                    End If
                End If
            End If
        End If
    End Sub

    Private Sub tabControl_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)
        If (Me._dragBehavior = TabDragBehavior.TabDragOut) Then
            Dim frm As New TabForm(dragTab)
        End If
    End Sub

#Region &quot; Private Methods &quot;

    Private Function TabUnderMouse() As TabPage
        Dim HTI As NativeMethods.TCHITTESTINFO = New NativeMethods.TCHITTESTINFO(tabControl.PointToClient(Cursor.Position))
        Dim tabID As Int32 = NativeMethods.SendMessage(tabControl.Handle, NativeMethods.TCM_HITTEST, IntPtr.Zero, HTI)
        Return If(tabID = -1, Nothing, tabControl.TabPages(tabID))
    End Function

    Private Function PointInTabStrip(ByVal point As Point) As Boolean
        Dim tabBounds As Rectangle = Rectangle.Empty
        Dim displayRC As Rectangle = tabControl.DisplayRectangle

        Select Case tabControl.Alignment
            Case TabAlignment.Bottom
                tabBounds.Location = New Point(0, displayRC.Bottom)
                tabBounds.Size = New Size(tabControl.Width, tabControl.Height - displayRC.Height)

            Case TabAlignment.Left
                tabBounds.Size = New Size(displayRC.Left, tabControl.Height)

            Case TabAlignment.Right
                tabBounds.Location = New Point(displayRC.Right, 0)
                tabBounds.Size = New Size(tabControl.Width - displayRC.Width, tabControl.Height)

            Case Else
                tabBounds.Size = New Size(tabControl.Width, displayRC.Top)
        End Select

        tabBounds.Inflate(-3, -3)

        Return tabBounds.Contains(point)

    End Function

    Private Sub SwapTabPages(ByVal index1 As Int32, ByVal index2 As Int32)
        If ((index1 Or index2) &amp;lt;&amp;gt; -1) Then
            Dim tab1 As TabPage = tabControl.TabPages(index1)
            Dim tab2 As TabPage = tabControl.TabPages(index2)
            tabControl.TabPages(index1) = tab2
            tabControl.TabPages(index2) = tab1
        End If
    End Sub

#End Region

End Class

Friend Class TabForm
    Inherits Form

    Public Sub New(ByVal tabPage As TabPage)
        MyBase.New()
        Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
        Me.StartPosition = FormStartPosition.Manual
        Me.MinimizeBox = False
        Me.MaximizeBox = False
        Me.tabPage = tabPage
        tabPage.Tag = Me
        Me.tabControl = DirectCast(tabPage.Parent, TabControl)
        Me.tabID = tabControl.TabPages.IndexOf(tabPage)
        Me.ClientSize = tabPage.Size
        Me.Location = tabControl.PointToScreen(New Point(tabPage.Left, tabControl.PointToClient(Cursor.Position).Y - SystemInformation.ToolWindowCaptionHeight \ 2))
        Me.Text = tabPage.Text
        UnDockFromTab()
        Me.dragOffset = tabControl.PointToScreen(Cursor.Position)
        Me.dragOffset.X -= Me.Location.X
        Me.dragOffset.Y -= Me.Location.Y
    End Sub

    Private tabPage As TabPage
    Private tabControl As TabControl
    Private tabID As Int32
    Private dragOffset As Point

    Protected Overrides Sub OnClosed(ByVal e As EventArgs)
        MyBase.OnClosed(e)
        DockToTab()
    End Sub

    Protected Overrides Sub WndProc(ByRef m As Message)

        If (m.Msg = NativeMethods.WM_MOVING) Then

            Dim rc As NativeMethods.RECT = DirectCast(m.GetLParam(GetType(NativeMethods.RECT)), NativeMethods.RECT)
            Dim pt As Point = tabControl.PointToClient(Cursor.Position)
            Dim pageRect As Rectangle = tabControl.DisplayRectangle
            Dim tabsRect As Rectangle = Rectangle.Empty

            Select Case tabControl.Alignment

                Case TabAlignment.Left
                    tabsRect.Size = New Size(pageRect.Left, tabControl.Height)

                Case TabAlignment.Bottom
                    tabsRect.Location = New Point(0, pageRect.Bottom)
                    tabsRect.Size = New Size(tabControl.Width, tabControl.Bottom - pageRect.Bottom)

                Case TabAlignment.Right
                    tabsRect.Location = New Point(pageRect.Right, 0)
                    tabsRect.Size = New Size(tabControl.Right - pageRect.Right, tabControl.Height)

                Case Else
                    tabsRect.Size = New Size(tabControl.Width, pageRect.Top)
            End Select

            If tabsRect.Contains(pt) Then
                DockToTab()
            Else
                UnDockFromTab()
            End If

        End If

        MyBase.WndProc(m)

        Select Case m.Msg
            Case NativeMethods.WM_NCLBUTTONDBLCLK
                Me.Close()

            Case NativeMethods.WM_EXITSIZEMOVE
                If (Not Me.Visible) Then
                    Me.Close()
                End If

            Case NativeMethods.WM_MOUSEMOVE
                If (m.WParam.ToInt32() = 1) Then

                    If (Not captured) Then
                        Dim pt As Point = tabControl.PointToScreen((Cursor.Position))
                        Dim newPosition As Point = New Point(pt.X - dragOffset.X, pt.Y - dragOffset.Y)
                        Me.Location = newPosition
                    End If
                    Dim rc As NativeMethods.RECT = New NativeMethods.RECT(Me.Bounds)
                    Dim lParam As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(rc))
                    Marshal.StructureToPtr(rc, lParam, True)
                    NativeMethods.SendMessage(Me.Handle, NativeMethods.WM_MOVING, IntPtr.Zero, lParam)
                    Marshal.FreeHGlobal(lParam)
                End If

            Case NativeMethods.WM_SETCURSOR
                captured = True

            Case Else

        End Select

    End Sub

    Private captured As Boolean

    Private Sub DockToTab()

        If (Not tabControl.TabPages.Contains(tabPage)) Then
            For id As Int32 = Me.Controls.Count - 1 To 0 Step -1

                tabPage.Controls.Add(Me.Controls(0))
            Next
            tabControl.TabPages.Insert(tabID, tabPage)
            tabControl.SelectedTab = tabPage

            tabControl.Capture = True
            Me.Close()
        End If
    End Sub

    Private Sub UnDockFromTab()

        If (Me.Visible OrElse Me.IsDisposed) Then
            Return
        End If

        For id As Int32 = tabPage.Controls.Count - 1 To 0 Step -1
            Me.Controls.Add(tabPage.Controls(0))
        Next

        tabControl.TabPages.Remove(tabPage)
        Me.Capture = True
        Me.Show()
    End Sub

End Class

Friend NotInheritable Class NativeMethods

    &amp;lt;StructLayout(LayoutKind.Sequential)&amp;gt; _
    Public Structure RECT
        Public Left, Top, Right, Bottom As Int32
        Public Sub New(ByVal bounds As Rectangle)
            Me.Left = bounds.Left
            Me.Top = bounds.Top
            Me.Right = bounds.Right
            Me.Bottom = bounds.Bottom
        End Sub
        Public Overrides Function ToString() As String
            Return String.Format(&quot;{0}, {1}, {2}, {3}&quot;, Left, Top, Right, Bottom)
        End Function
    End Structure

    Public Const WM_NCLBUTTONDBLCLK As Int32 = &amp;amp;HA3

    Public Const WM_SETCURSOR As Int32 = &amp;amp;H20

    Public Const WM_NCHITTEST As Int32 = &amp;amp;H84

    Public Const WM_MOUSEMOVE As Int32 = &amp;amp;H200
    Public Const WM_MOVING As Int32 = &amp;amp;H216
    Public Const WM_EXITSIZEMOVE As Int32 = &amp;amp;H232

    &amp;lt;DllImport(&quot;user32.dll&quot;)&amp;gt; _
    Public Shared Function SendMessage(ByVal hwnd As IntPtr, ByVal msg As Int32, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Int32
    End Function
    &amp;lt;DllImport(&quot;user32.dll&quot;)&amp;gt; _
    Public Shared Function SendMessage(ByVal hwnd As IntPtr, ByVal msg As Int32, ByVal wParam As IntPtr, ByRef lParam As TCHITTESTINFO) As Int32
    End Function

    &amp;lt;StructLayout(LayoutKind.Sequential)&amp;gt; _
    Public Structure TCHITTESTINFO
        Public pt As Point
        Public flags As TCHITTESTFLAGS
        Public Sub New(ByVal point As Point)
            pt = point
            flags = TCHITTESTFLAGS.TCHT_ONITEM
        End Sub
    End Structure

    &amp;lt;Flags()&amp;gt; _
    Public Enum TCHITTESTFLAGS
        TCHT_NOWHERE = 1
        TCHT_ONITEMICON = 2
        TCHT_ONITEMLABEL = 4
        TCHT_ONITEM = TCHT_ONITEMICON Or TCHT_ONITEMLABEL
    End Enum

    Public Const TCM_HITTEST As Int32 = &amp;amp;H130D

End Class

Public Enum TabDragBehavior
    None
    TabDragArrange
    TabDragOut
End Enum
                    
&lt;/pre&gt;&lt;/div&gt;&lt;hr /&gt;&lt;h3&gt;CSharp Class:&lt;/h3&gt;&lt;button onclick=&quot;showHideById(&#39;CScode&#39;)&quot;&gt;Show/Hide&lt;/button&gt;&lt;br /&gt;
&lt;div id=&quot;CScode&quot; style=&quot;border: solid 1px blue; display: none; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; margin: 3px;&quot;&gt;&lt;pre style=&quot;overflow: scroll; width: 100%;&quot;&gt;internal class TabDragger
{
    public TabDragger(TabControl tabControl)
        : base()
    {
        this.tabControl = tabControl;
        tabControl.MouseDown +=new MouseEventHandler(tabControl_MouseDown);
        tabControl.MouseMove += new MouseEventHandler(tabControl_MouseMove);
        tabControl.DoubleClick += new EventHandler(tabControl_DoubleClick);
    }

    public TabDragger(TabControl tabControl, TabDragBehavior behavior) 
        : this(tabControl)
    {
        this.dragBehavior = behavior;
    }

    private TabControl tabControl;
    private TabPage dragTab = null;
    private TabDragBehavior dragBehavior = TabDragBehavior.TabDragArrange;

    private TabDragBehavior DragBehavior
    {
        get
        {
            if (!tabControl.Multiline)
                return dragBehavior;
            return TabDragBehavior.None;
        }
    }

    private void tabControl_MouseDown(object sender, MouseEventArgs e)
    {
        dragTab = TabUnderMouse();
    }

    private void tabControl_MouseMove(object sender, MouseEventArgs e)
    {
        if (DragBehavior == TabDragBehavior.None)
            return;

        if (e.Button == MouseButtons.Left)
        {
            if (dragTab != null)
            {
                if (tabControl.TabPages.Contains(dragTab))
                {
                    if (PointInTabStrip(e.Location))
                    {
                        TabPage hotTab = TabUnderMouse();
                        if (hotTab != dragTab &amp;amp;&amp;amp; hotTab != null)
                        {
                            int id1 = tabControl.TabPages.IndexOf(dragTab);
                            int id2 = tabControl.TabPages.IndexOf(hotTab);
                            if (id1 &amp;gt; id2)
                            {
                                for (int id = id2; id &amp;lt;= id1; id++)
                                {
                                    SwapTabPages(id1, id);
                                }
                            }
                            else
                            {
                                for (int id = id2; id &amp;gt; id1; id--)
                                {
                                    SwapTabPages(id1, id);
                                }
                            }
                            tabControl.SelectedTab = dragTab;
                        }
                    }
                    else
                    {
                        if (this.dragBehavior == TabDragBehavior.TabDragOut)
                        {
                            if (dragTab.Tag != null)
                            {
                                ((TabForm)dragTab.Tag).Dispose();
                                dragTab.Tag = null;
                            }
                            else
                            {
                                TabForm frm = new TabForm(dragTab);
                            }
                        }
                    }
                }
            }
        }
    }

    private void tabControl_DoubleClick(object sender, EventArgs e)
    {
        if (this.DragBehavior == TabDragBehavior.TabDragOut)
        {
            TabForm frm = new TabForm(dragTab);
        }
    }

    #region Private Methods

    private TabPage TabUnderMouse()
    {
        NativeMethods.TCHITTESTINFO HTI = new NativeMethods.TCHITTESTINFO(tabControl.PointToClient(Cursor.Position));
        int tabID = NativeMethods.SendMessage(tabControl.Handle, NativeMethods.TCM_HITTEST, IntPtr.Zero, ref HTI);
        return tabID == -1 ? null : tabControl.TabPages[tabID];
    }

    private bool PointInTabStrip(Point point)
    {
        Rectangle tabBounds = Rectangle.Empty;
        Rectangle displayRC = tabControl.DisplayRectangle; ;

        switch (tabControl.Alignment)
        {
            case TabAlignment.Bottom:
                tabBounds.Location = new Point(0, displayRC.Bottom);
                tabBounds.Size = new Size(tabControl.Width, tabControl.Height - displayRC.Height);
                break;

            case TabAlignment.Left:
                tabBounds.Size = new Size(displayRC.Left, tabControl.Height);
                break;

            case TabAlignment.Right:
                tabBounds.Location = new Point(displayRC.Right, 0);
                tabBounds.Size = new Size(tabControl.Width - displayRC.Width, tabControl.Height);
                break;

            default:
                tabBounds.Size = new Size(tabControl.Width, displayRC.Top);
                break;
        }
        tabBounds.Inflate(-3, -3);
        return tabBounds.Contains(point);
    }

    private void SwapTabPages(int index1, int index2)
    {
        if ((index1 | index2) != -1)
        {
            TabPage tab1 = tabControl.TabPages[index1];
            TabPage tab2 = tabControl.TabPages[index2];
            tabControl.TabPages[index1] = tab2;
            tabControl.TabPages[index2] = tab1;
        }
    }

    #endregion

}

internal class TabForm : Form
{
    public TabForm(TabPage tabPage)
        : base()
    {
        this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
        this.StartPosition = FormStartPosition.Manual;
        this.MinimizeBox = false;
        this.MaximizeBox = false;
        this.tabPage = tabPage;
        tabPage.Tag = this;
        this.tabControl = (TabControl)tabPage.Parent;
        this.tabID = tabControl.TabPages.IndexOf(tabPage);
        this.ClientSize = tabPage.Size;
        this.Location = tabControl.PointToScreen(new Point(tabPage.Left, tabControl.PointToClient(Cursor.Position).Y - SystemInformation.ToolWindowCaptionHeight / 2));
        this.Text = tabPage.Text;
        UnDockFromTab();
        this.dragOffset = tabControl.PointToScreen(Cursor.Position);
        this.dragOffset.X -= this.Location.X ;
        this.dragOffset.Y -= this.Location.Y;
    }

    private TabPage tabPage;
    private TabControl tabControl;
    private int tabID;
    private Point dragOffset;

    protected override void OnClosed(EventArgs e)
    {
        base.OnClosed(e);
        DockToTab();
    }

    protected override void WndProc(ref Message m)
    {
        if (m.Msg == NativeMethods.WM_MOVING)
        {
            NativeMethods.RECT rc = (NativeMethods.RECT)m.GetLParam(typeof(NativeMethods.RECT));
            Point pt = tabControl.PointToClient(Cursor.Position);
            Rectangle pageRect = tabControl.DisplayRectangle;
            Rectangle tabsRect = Rectangle.Empty;
            switch (tabControl.Alignment)
            {
                case TabAlignment.Left:
                    tabsRect.Size = new Size(pageRect.Left, tabControl.Height);
                    break;

                case TabAlignment.Bottom:
                    tabsRect.Location = new Point(0, pageRect.Bottom);
                    tabsRect.Size = new Size(tabControl.Width, tabControl.Bottom - pageRect.Bottom);
                    break;

                case TabAlignment.Right:
                    tabsRect.Location = new Point(pageRect.Right, 0);
                    tabsRect.Size = new Size(tabControl.Right - pageRect.Right, tabControl.Height);
                    break;

                default:
                    tabsRect.Size = new Size(tabControl.Width, pageRect.Top);
                    break;

            }
            if (tabsRect.Contains(pt))
                DockToTab();
            else
                UnDockFromTab();
        }

        base.WndProc(ref m);
            
        switch (m.Msg)
        {
            case NativeMethods.WM_NCLBUTTONDBLCLK:
                this.Close();
                break;

            case NativeMethods.WM_EXITSIZEMOVE:
                if (!this.Visible)
                    this.Close();
                break;

            case NativeMethods.WM_MOUSEMOVE:
                if (m.WParam.ToInt32() == 1)
                {
                    if (!captured)
                    {
                        Point pt = tabControl.PointToScreen((Cursor.Position));
                        Point newPosition = new Point(pt.X - dragOffset.X, pt.Y - dragOffset.Y);
                        this.Location = newPosition;
                    }
                    NativeMethods.RECT rc = new NativeMethods.RECT(this.Bounds);
                    IntPtr lParam = Marshal.AllocHGlobal(Marshal.SizeOf(rc));
                    Marshal.StructureToPtr(rc, lParam, true);
                    NativeMethods.SendMessage(this.Handle, NativeMethods.WM_MOVING, IntPtr.Zero, lParam);
                    Marshal.FreeHGlobal(lParam);
                }
                break;

            case NativeMethods.WM_SETCURSOR:
                captured = true;
                break;

            default:
                break;
        }

    }

    private bool captured;

    private void DockToTab()
    {
        if (!tabControl.TabPages.Contains(tabPage))
        {
            for (int id = this.Controls.Count - 1; id &amp;gt;= 0; id--)
            {
                tabPage.Controls.Add(this.Controls[0]);
            }
            tabControl.TabPages.Insert(tabID, tabPage);
            tabControl.SelectedTab = tabPage;

            tabControl.Capture = true;
            this.Close();
        }
    }

    private void UnDockFromTab()
    {
        if (this.Visible || this.IsDisposed)
            return;
        for (int id = tabPage.Controls.Count - 1; id &amp;gt;= 0; id--)
        {
            this.Controls.Add(tabPage.Controls[0]);
        }

        tabControl.TabPages.Remove(tabPage);
        this.Capture = true;
        this.Show();
    }

}

internal sealed class NativeMethods
{

    [StructLayout(LayoutKind.Sequential)]
    public struct RECT
    {
        public int Left, Top, Right, Bottom;
        public RECT(Rectangle bounds)
        {
            this.Left = bounds.Left;
            this.Top = bounds.Top;
            this.Right = bounds.Right;
            this.Bottom = bounds.Bottom;
        }
        public override string ToString()
        {
            return String.Format(&quot;{0}, {1}, {2}, {3}&quot;, Left, Top, Right, Bottom);
        }
    }

    public const int WM_NCLBUTTONDBLCLK = 0xA3;
    
    public const int WM_SETCURSOR = 0x20;

    public const int WM_NCHITTEST = 0x84;

    public const int WM_MOUSEMOVE = 0x200;
    public const int WM_MOVING = 0x216;
    public const int WM_EXITSIZEMOVE = 0x232;

    [DllImport(&quot;user32.dll&quot;)]
    public static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);

    [DllImport(&quot;user32.dll&quot;)]
    public static extern int SendMessage(IntPtr hwnd, int msg, IntPtr wParam, ref TCHITTESTINFO lParam);

    [StructLayout(LayoutKind.Sequential)]
    public struct TCHITTESTINFO
    {
        public Point pt;
        public TCHITTESTFLAGS flags;
        public TCHITTESTINFO(Point point)
        {
            pt = point;
            flags = TCHITTESTFLAGS.TCHT_ONITEM;
        }
    }

    [Flags()]
    public enum TCHITTESTFLAGS
    {
        TCHT_NOWHERE = 1,
        TCHT_ONITEMICON = 2,
        TCHT_ONITEMLABEL = 4,
        TCHT_ONITEM = TCHT_ONITEMICON | TCHT_ONITEMLABEL
    }

    public const int TCM_HITTEST = 0x130D;

}

public enum TabDragBehavior
{None, TabDragArrange, TabDragOut }
                    
&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xkom.blogspot.com/feeds/6661137944890948078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://xkom.blogspot.com/2011/07/tabdragging-example-using-tabdragger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6661137944890948078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1847278434515420457/posts/default/6661137944890948078'/><link rel='alternate' type='text/html' href='http://xkom.blogspot.com/2011/07/tabdragging-example-using-tabdragger.html' title='TabDragging Example using TabDragger Class'/><author><name>Klampok Child</name><uri>http://www.blogger.com/profile/13867130473786364775</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaNGA6WQgDdnY5EVJ01BW0kyVFAT-mTGFy_3qyvEpXRcdTB4EyqHB9qFVprZWfx9QXBY4t597AJnb1yqrfA4sInqU3aabEvbGribjFBMdAPiF1x_I1Kf896ITaPK8MLQ/s113/tmp.png'/></author><thr:total>0</thr:total></entry></feed>