<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>// do something here &#187; VB.NET</title>
	<atom:link href="http://www.dosomethinghere.com/tag/vbnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dosomethinghere.com</link>
	<description>Turning impossibilities into 1s and 0s professionally since 0&#120;07C1</description>
	<lastBuildDate>Thu, 29 Jul 2010 14:46:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>2010 Central Ohio Day of .NET</title>
		<link>http://www.dosomethinghere.com/2010/06/05/2010-central-ohio-day-of-net/</link>
		<comments>http://www.dosomethinghere.com/2010/06/05/2010-central-ohio-day-of-net/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 23:48:56 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[CONDG]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=535</guid>
		<description><![CDATA[A co-w0rker and I attended the Central Ohio Day of .NET on June 5, 2010. There was quite a bit of good content at the conference, which is a real tribute to the organizers, volunteers, and presenters.
The highlights of my day were sitting in on Matt Casto&#8217;s regular expressions talk, Phil Japikse&#8217;s M-V-VM primer, discussing [...]]]></description>
			<content:encoded><![CDATA[<p>A co-w0rker and I attended the Central Ohio Day of .NET on June 5, 2010. There was quite a bit of good content at the conference, which is a real tribute to the organizers, volunteers, and presenters.</p>
<p>The highlights of my day were sitting in on Matt Casto&#8217;s regular expressions talk, Phil Japikse&#8217;s M-V-VM primer, discussing the etymology of the MongoDB project with Sam Corder (I still say it was named such after the character in Blazing Saddles), Michael Eaton&#8217;s talk on WPF, and Parag Joshi&#8217;s demonstration of XNA/Windows Phone 7 game development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/06/05/2010-central-ohio-day-of-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET Printing For Dummies</title>
		<link>http://www.dosomethinghere.com/2010/03/16/vb-net-printing-for-dummies/</link>
		<comments>http://www.dosomethinghere.com/2010/03/16/vb-net-printing-for-dummies/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 01:02:18 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=485</guid>
		<description><![CDATA[In order to send stuff to the printer in VB.NET, it is not quite as simple as dealing with the Printer object as in VB6. There are a couple of extra steps involved. Here is what I found, along with some helper methods that you might find useful.
On the form you want to print from, [...]]]></description>
			<content:encoded><![CDATA[<p>In order to send stuff to the printer in VB.NET, it is not quite as simple as dealing with the Printer object as in VB6. There are a couple of extra steps involved. Here is what I found, along with some helper methods that you might find useful.</p>
<p>On the form you want to print from, pull up the Toolbox and add a PrintDocument, a PrintDialog, and a Button, set the Document property of the PrintDialog to point to the PrintDocument you just created, and in the button&#8217;s Click event, insert the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> butPrint_Click<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> butPrint.<span style="color: #0000FF;">Click</span>
&nbsp;
        <span style="color: #0600FF;">If</span> PrintDialog1.<span style="color: #0000FF;">ShowDialog</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> Windows.<span style="color: #0000FF;">Forms</span>.<span style="color: #0000FF;">DialogResult</span>.<span style="color: #0600FF;">OK</span> <span style="color: #FF8000;">Then</span>
            PrintDocument1.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">Landscape</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
            PrintDocument1.<span style="color: #FF8000;">Print</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span>
&nbsp;
    <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> PrintDocument1_PrintPage<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">Drawing</span>.<span style="color: #0000FF;">Printing</span>.<span style="color: #0000FF;">PrintPageEventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> PrintDocument1.<span style="color: #0000FF;">PrintPage</span>
&nbsp;
        PrintTestPage<span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Graphics</span>, PrintDocument1<span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>The Print method call in the button click event then fires the PrintDocument PrintPage event. Notice that I have set the default page settings to landscape. Don&#8217;t forget to wire the PrintDialog Document property to your PrintDocument, otherwise if you change the printer to print to in the print dialog, the document will still go to the default printer.</p>
<p>The PrintTestPage method is just something simple that I put together to make sure that the coordinates and justifications are all working fine. Here is that code:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #0600FF;">Sub</span> PrintTestPage<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> g <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">Drawing</span>.<span style="color: #0000FF;">Graphics</span>, <span style="color: #FF8000;">ByVal</span> doc <span style="color: #FF8000;">As</span> PrintDocument<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> x, y <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span>
&nbsp;
        <span style="color: #FF8000;">For</span> x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">100</span> <span style="color: #FF8000;">Step</span> <span style="color: #FF0000;">10</span>
            <span style="color: #FF8000;">For</span> y <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">100</span> <span style="color: #FF8000;">Step</span> <span style="color: #FF0000;">10</span>
                PrintAtLocationWithColor<span style="color: #000000;">&#40;</span>g, doc, x.<span style="color: #0000FF;">ToString</span> <span style="color: #008000;">+</span> <span style="color: #808080;">&quot;, &quot;</span> <span style="color: #008000;">+</span> y.<span style="color: #0000FF;">ToString</span>, x, y, _
                                         <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, <span style="color: #808080;">&quot;L&quot;</span>, <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>x <span style="color: #008000;">=</span> <span style="color: #FF0000;">100</span>, <span style="color: #808080;">&quot;R&quot;</span>, <span style="color: #808080;">&quot;C&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>y <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, <span style="color: #808080;">&quot;T&quot;</span>, <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>y <span style="color: #008000;">=</span> <span style="color: #FF0000;">100</span>, <span style="color: #808080;">&quot;B&quot;</span>, <span style="color: #808080;">&quot;C&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, _
                                         <span style="color: #808080;">&quot;Arial&quot;</span>, <span style="color: #FF0000;">8</span>, <span style="color: #0600FF;">True</span>, Brushes.<span style="color: #0600FF;">Red</span><span style="color: #000000;">&#41;</span>
            <span style="color: #FF8000;">Next</span>
        <span style="color: #FF8000;">Next</span>
&nbsp;
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">100</span>, <span style="color: #FF0000;">100</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">10</span>, <span style="color: #FF0000;">10</span>, <span style="color: #FF0000;">80</span>, <span style="color: #FF0000;">80</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">20</span>, <span style="color: #FF0000;">20</span>, <span style="color: #FF0000;">60</span>, <span style="color: #FF0000;">60</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">30</span>, <span style="color: #FF0000;">30</span>, <span style="color: #FF0000;">40</span>, <span style="color: #FF0000;">40</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">40</span>, <span style="color: #FF0000;">40</span>, <span style="color: #FF0000;">20</span>, <span style="color: #FF0000;">20</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>The two methods called here, PrintAtLocationWithColor and PrintRectangle, are shown here:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #0600FF;">Sub</span> PrintAtLocationWithColor<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> pg <span style="color: #FF8000;">As</span> Graphics, <span style="color: #FF8000;">ByVal</span> pd <span style="color: #FF8000;">As</span> PrintDocument, <span style="color: #FF8000;">ByVal</span> s <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, _
                                <span style="color: #FF8000;">ByVal</span> xPosition <span style="color: #FF8000;">As</span> Single, <span style="color: #FF8000;">ByVal</span> yPosition <span style="color: #FF8000;">As</span> Single, _
                                <span style="color: #FF8000;">ByVal</span> justification <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, <span style="color: #FF8000;">ByVal</span> verticalJustification <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, _
                                <span style="color: #FF8000;">ByVal</span> fontFace <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, <span style="color: #FF8000;">ByVal</span> fontSize <span style="color: #FF8000;">As</span> Single, _
                                <span style="color: #FF8000;">ByVal</span> fontBold <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Boolean</span>, <span style="color: #FF8000;">ByVal</span> theColor <span style="color: #FF8000;">As</span> Brush<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> w, h <span style="color: #FF8000;">As</span> Single
        <span style="color: #0600FF;">Dim</span> x, y <span style="color: #FF8000;">As</span> Single
        <span style="color: #0600FF;">Dim</span> f <span style="color: #FF8000;">As</span> Font
        <span style="color: #0600FF;">Dim</span> sty <span style="color: #FF8000;">As</span> FontStyle
&nbsp;
        sty <span style="color: #008000;">=</span> FontStyle.<span style="color: #0000FF;">Regular</span>
        <span style="color: #0600FF;">If</span> fontBold <span style="color: #FF8000;">Then</span> sty <span style="color: #008000;">=</span> sty <span style="color: #008000;">+</span> FontStyle.<span style="color: #0000FF;">Bold</span>
        <span style="color: #0600FF;">If</span> fontSize &lt; <span style="color: #FF0000;">1</span> <span style="color: #FF8000;">Then</span> fontSize <span style="color: #008000;">=</span> <span style="color: #FF0000;">8.0</span>
        f <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> Font<span style="color: #000000;">&#40;</span>fontFace, fontSize, sty<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">If</span> pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">Landscape</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Else</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        w <span style="color: #008000;">=</span> pg.<span style="color: #0000FF;">MeasureString</span><span style="color: #000000;">&#40;</span>s, f<span style="color: #000000;">&#41;</span>.<span style="color: #0600FF;">Width</span>
        h <span style="color: #008000;">=</span> pg.<span style="color: #0000FF;">MeasureString</span><span style="color: #000000;">&#40;</span>s, f<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Height</span>
&nbsp;
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>justification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;C&quot;</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> x <span style="color: #008000;">-</span> w <span style="color: #008000;">/</span> <span style="color: #FF0000;">2</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>justification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;R&quot;</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> x <span style="color: #008000;">-</span> w
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>verticalJustification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;C&quot;</span> <span style="color: #FF8000;">Then</span>
            y <span style="color: #008000;">=</span> y <span style="color: #008000;">-</span> h <span style="color: #008000;">/</span> <span style="color: #FF0000;">2</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>verticalJustification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;B&quot;</span> <span style="color: #FF8000;">Then</span>
            y <span style="color: #008000;">=</span> y <span style="color: #008000;">-</span> h
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        pg.<span style="color: #0000FF;">DrawString</span><span style="color: #000000;">&#40;</span>s, f, theColor, x, y<span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span>
&nbsp;
    <span style="color: #0600FF;">Sub</span> PrintRectangle<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> pg <span style="color: #FF8000;">As</span> Graphics, <span style="color: #FF8000;">ByVal</span> pd <span style="color: #FF8000;">As</span> PrintDocument, <span style="color: #FF8000;">ByVal</span> xPosition <span style="color: #FF8000;">As</span> Single, <span style="color: #FF8000;">ByVal</span> yPosition <span style="color: #FF8000;">As</span> Single, _
                                <span style="color: #FF8000;">ByVal</span> <span style="color: #0600FF;">width</span> <span style="color: #FF8000;">As</span> Single, <span style="color: #FF8000;">ByVal</span> height <span style="color: #FF8000;">As</span> Single<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> w, h <span style="color: #FF8000;">As</span> Single
        <span style="color: #0600FF;">Dim</span> x, y <span style="color: #FF8000;">As</span> Single
&nbsp;
        <span style="color: #0600FF;">If</span> pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">Landscape</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            w <span style="color: #008000;">=</span> <span style="color: #0600FF;">width</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            h <span style="color: #008000;">=</span> height <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Else</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            w <span style="color: #008000;">=</span> <span style="color: #0600FF;">width</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            h <span style="color: #008000;">=</span> height <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        pg.<span style="color: #0000FF;">DrawRectangle</span><span style="color: #000000;">&#40;</span>Pens.<span style="color: #0600FF;">Black</span>, x, y, w, h<span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>All of the positioning and size parameters of these methods are percentages across and down the page, which I find much easier to deal with than absolute or printer specific positioning. This makes it dead simple to scale the reports to any page size I want to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/03/16/vb-net-printing-for-dummies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Kombat (Format vs. ToString)</title>
		<link>http://www.dosomethinghere.com/2010/02/23/net-kombat-format-vs-tostring/</link>
		<comments>http://www.dosomethinghere.com/2010/02/23/net-kombat-format-vs-tostring/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 03:43:51 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=468</guid>
		<description><![CDATA[In converting some legacy VB6 code to VB.NET, I noticed that there was a lot of use of the Format function in the code to convert numbers to strings. This makes sense as Format was pretty much the only game in town in VB6.
However, in .NET, they introduced a handy-dandy .ToString() method that, on the [...]]]></description>
			<content:encoded><![CDATA[<p>In converting some legacy VB6 code to VB.NET, I noticed that there was a lot of use of the Format function in the code to convert numbers to strings. This makes sense as Format was pretty much the only game in town in VB6.</p>
<p>However, in .NET, they introduced a handy-dandy .ToString() method that, on the surface, seems to do much the same thing as the Format function. I have been able to use them pretty much interchangeably with the desired results coming out every time.</p>
<p>I started to wonder which way was faster. Since I am a big proponent of empirical knowledge instead of just trying to get the theoretical story behind the two ways to do this, I rolled together this quick VB.NET console application:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">Imports System.Text
&nbsp;
Module Module1
&nbsp;
    <span style="color: #000080;">Sub</span> Main()
&nbsp;
        <span style="color: #000080;">Dim</span> i <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>
        <span style="color: #000080;">Dim</span> r <span style="color: #000080;">As</span> <span style="color: #000080;">Random</span> = <span style="color: #000080;">New</span> <span style="color: #000080;">Random</span>()
        <span style="color: #000080;">Dim</span> t <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
&nbsp;
        System.Console.WriteLine(<span style="color: #800000;">&quot;10,000,000 Formats&quot;</span>)
        <span style="color: #000080;">Dim</span> sb1 <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> stringbuilder
        t = Timer
        <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">To</span> 10000000
            sb1.<span style="color: #000080;">Append</span>(Format(r.NextDouble * 100.0, <span style="color: #800000;">&quot;###0.00 &quot;</span>))
        <span style="color: #000080;">Next</span>
        System.Console.WriteLine(<span style="color: #800000;">&quot;Seconds elapsed: &quot;</span> + (Timer - t).ToString(<span style="color: #800000;">&quot;#######0.00&quot;</span>))
        System.Console.WriteLine(<span style="color: #800000;">&quot;Length of string builder: &quot;</span> + sb1.Length.ToString())
        System.Console.WriteLine()
&nbsp;
        System.Console.WriteLine(<span style="color: #800000;">&quot;10,000,000 ToStrings&quot;</span>)
        <span style="color: #000080;">Dim</span> sb2 <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> StringBuilder
        t = Timer
        <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">To</span> 10000000
            sb2.<span style="color: #000080;">Append</span>((r.NextDouble * 100.0).ToString(<span style="color: #800000;">&quot;###0.00 &quot;</span>))
        <span style="color: #000080;">Next</span>
        System.Console.WriteLine(<span style="color: #800000;">&quot;Seconds elapsed: &quot;</span> + (Timer - t).ToString(<span style="color: #800000;">&quot;#######0.00&quot;</span>))
        System.Console.WriteLine(<span style="color: #800000;">&quot;Length of string builder: &quot;</span> + sb2.Length.ToString())
        System.Console.WriteLine()
&nbsp;
        System.Console.WriteLine(<span style="color: #800000;">&quot;Press any key to end the program &quot;</span>)
        System.Console.ReadKey()
&nbsp;
    <span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span>
&nbsp;
<span style="color: #000080;">End</span> Module</pre></div></div>

<p>And here are the results:</p>
<p><a href="http://www.dosomethinghere.com/wp-content/uploads/2010/02/FormatVsToString.png"><img class="alignnone size-full wp-image-469" title="FormatVsToString" src="http://www.dosomethinghere.com/wp-content/uploads/2010/02/FormatVsToString.png" alt="" width="668" height="331" /></a></p>
<p>As you can see, the ToString method is about 15% faster when doing 10 million calls with random numbers.</p>
<p>Oh, and by the way, Happy <a href="http://www.ihoppancakeday.com/" target="_blank">Pancake Day</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/02/23/net-kombat-format-vs-tostring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy way to format the time difference between two dates</title>
		<link>http://www.dosomethinghere.com/2010/01/27/easy-way-to-format-the-time-difference-between-two-dates/</link>
		<comments>http://www.dosomethinghere.com/2010/01/27/easy-way-to-format-the-time-difference-between-two-dates/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:56:36 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=457</guid>
		<description><![CDATA[In converting my VB6 code over to VB.NET, I was looking for an easy way to take the different between two DateTime items and display in hours and minutes.  The TimeSpan gives a nice structure to dive into the difference and see exactly the interval, but I was hoping to find a way to output [...]]]></description>
			<content:encoded><![CDATA[<p>In converting my VB6 code over to VB.NET, I was looking for an easy way to take the different between two DateTime items and display in hours and minutes.  The TimeSpan gives a nice structure to dive into the difference and see exactly the interval, but I was hoping to find a way to output this in the same way that you can use the ToShortTimeString method of DateTime.</p>
<p>As it turns out, I found a posting by Jay Barlow that mentions converting the time different to a date time, and then using a custom format string to do the work so that I wouldn&#8217;t have to.  Here is my new VB.NET code, where rec is a class that includes the start and end date and duration is a string that holds the information to be displayed:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">If</span> rec.endDate IsNot <span style="color: #000080;">Nothing</span> <span style="color: #000080;">Then</span>
    <span style="color: #000080;">Dim</span> ts <span style="color: #000080;">As</span> TimeSpan = <span style="color: #000080;">CDate</span>(rec.endDate).Subtract(rec.startDate)
    <span style="color: #000080;">Dim</span> dt <span style="color: #000080;">As</span> DateTime = DateTime.MinValue.Add(ts)
    duration = <span style="color: #800000;">&quot;Event duration: &quot;</span> + dt.ToString(<span style="color: #800000;">&quot;H:mm&quot;</span>)
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span></pre></div></div>

<p>Oh, and one more thing.  Am I the only one in the world that thinks that iPad is the worst product name in history? Sure, it is so close to iPod so as to create brand recognition and draw comparisons, but I would just wonder what kind of names were shot down, and if any of them did not begin with the letter i.</p>
<p>By the way, Happy (Belated) Australia Day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/01/27/easy-way-to-format-the-time-difference-between-two-dates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VB.NET radio button groups act differently than VB6 radio button groups</title>
		<link>http://www.dosomethinghere.com/2010/01/08/vb-net-radio-button-groups-act-differently-than-vb6-radio-button-groups/</link>
		<comments>http://www.dosomethinghere.com/2010/01/08/vb-net-radio-button-groups-act-differently-than-vb6-radio-button-groups/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 03:18:42 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=452</guid>
		<description><![CDATA[The few dozen remaining WinForms developers left on this planet may have noticed that, for some reason, a group box with radio buttons in it as designed in the Visual Studio 2008 environment will have the first radio button of the first group box automatically selected when the form comes up, even though all of [...]]]></description>
			<content:encoded><![CDATA[<p>The few dozen remaining WinForms developers left on this planet may have noticed that, for some reason, a group box with radio buttons in it as designed in the Visual Studio 2008 environment will have the first radio button of the first group box automatically selected when the form comes up, even though all of the radio buttons have their Checked property set to false in the design environment.  It never used to do this in VB6, as when you ran the application, the group of radio buttons would have no members selected.</p>
<p>The problem manifests itself when you are trying to perform additional tasks in the CheckedChanged event of the radio buttons when the user selects one of the radio buttons, since the first radio button is being automatically selected.</p>
<p>I asked this question on Stack Overflow, and got a couple of replies. The one that I finally used to solve the problem was to set the Checked property of the radio buttons to false in the form&#8217;s Shown event, which I had never used before. By doing this, the first radio button was no longer automatically showing up checked.</p>
<p>One other thing that I had to do in addition was to cast the sender into a RadioButton and look at the Checked property of the clicked radio button in the CheckedChanged event, as that event is fired for radio buttons both being turned on and also turned off.</p>
<p>Oh, and happy National English Toffee Day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/01/08/vb-net-radio-button-groups-act-differently-than-vb6-radio-button-groups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Control arrays in VB.NET</title>
		<link>http://www.dosomethinghere.com/2009/12/28/control-arrays-in-vb-net/</link>
		<comments>http://www.dosomethinghere.com/2009/12/28/control-arrays-in-vb-net/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 00:57:54 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=443</guid>
		<description><![CDATA[One of the things that I really liked (and used quite a bit) in the VB6 IDE was the ability to use the design surface to create a form with a bunch of controls with the same name as a control array. You would create the controls on the design page, give it the same [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that I really liked (and used quite a bit) in the VB6 IDE was the ability to use the design surface to create a form with a bunch of controls with the same name as a control array. You would create the controls on the design page, give it the same name as another control, and the Index property would automatically be incremented. This would then let me use a loop to manipulate and examine these controls.</p>
<p>This functionality is missing in VB.NET, as I discovered when I tried to do my first .NET Compact Framework application way back when Visual Studio 2003 was shiny and new, and has continued to be missing from the feature set in VS2005 and VS2008.</p>
<p>Microsoft is not much help on this front. Their solution is to create the forms in code, as described in this article:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa289500(VS.71).aspx" target="_blank">Not so helpful link</a></p>
<p>But I like using the design surface to create forms. A co-worker suggested we try to do a test in C# and tamper with the designer.cs file to create an array of controls in there, which worked OK. The big problems there were that the controls showed up on the design surface, but they could not be clicked and modified. Also, when we added a control to the form and saved it, all of the customizations we made to the designer file disappeared. (Oops.)</p>
<p>So instead, what I am now doing is creating my forms in the designer as before, with each control of the set having a different name with a number after it (such as cboName0, cboName1, etc.), referring to the index of the control in the array. At the top of the form&#8217;s class I have the arrays defined:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Dim</span> cboName<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">as</span> ComboBox
<span style="color: #0600FF;">Dim</span> lblNumber<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">10</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">as</span> Label</pre></div></div>

<p>Then, in the form load event, I am calling this subroutine:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Sub</span> SetUpControlArrays<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> cb In <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">OfType</span><span style="color: #000000;">&#40;</span>Of ComboBox<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">If</span> cb.<span style="color: #0000FF;">Name</span>.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;cboName&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span>
            cboName<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">CInt</span><span style="color: #000000;">&#40;</span>cb.<span style="color: #0000FF;">Name</span>.<span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;cboName&quot;</span>, <span style="color: #808080;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> cb
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
    <span style="color: #FF8000;">Next</span>
&nbsp;
    <span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> lbl In <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">OfType</span><span style="color: #000000;">&#40;</span>Of Label<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">If</span> lbl.<span style="color: #0000FF;">Name</span>.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;lblNumber&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span>
            lblNumber<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">CInt</span><span style="color: #000000;">&#40;</span>lbl.<span style="color: #0000FF;">Name</span>.<span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;lblNumber&quot;</span>, <span style="color: #808080;">&quot;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> lbl
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
    <span style="color: #FF8000;">Next</span>
&nbsp;
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>Now I have the ability to address the controls in the same way that I used to do in VB6. The fact that I lived with this missing feature for about 6 years and just now figuring out a decent way around the problem pretty much guarantees that VS2010 will put the control arrays back in.</p>
<p><strong>EDIT:</strong> At the request of a Strong Bad fan who shall remain nameless, I changed up the code above to be a bit more friendly. The previous code only extracted the rightmost 1 character from the name of the control on the design surface, which would not work if you had a control name such as cboName10.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2009/12/28/control-arrays-in-vb-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Demo days (CONDG meeting, December 14, 2009)</title>
		<link>http://www.dosomethinghere.com/2009/12/15/demo-days-condg-meeting-december-14-2009/</link>
		<comments>http://www.dosomethinghere.com/2009/12/15/demo-days-condg-meeting-december-14-2009/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 14:52:58 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[CONDG]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=426</guid>
		<description><![CDATA[2009-12-15 09.13.18]]></description>
			<content:encoded><![CDATA[<p>The Central Ohio .NET Developers Group held their final meeting of the year last night at the Microsoft office in Polaris. Four people gave short demos of Xbox, Zune HD, Windows Mobile, and iPhone, and talked about developing for each platform.</p>
<p>The highlight of the evening was my name being drawn as winning the year&#8217;s final and perhaps most craptastic door prize, which I then gave to my coworker who was attending the meeting with me. He is into free t-shirts.</p>
<p><img class="alignnone size-full wp-image-429" title="2009-12-15 09.13.18" src="http://www.dosomethinghere.com/wp-content/uploads/2009/12/2009-12-15-09.13.18.jpg" alt="2009-12-15 09.13.18" width="480" height="643" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2009/12/15/demo-days-condg-meeting-december-14-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to get the version number of a running process</title>
		<link>http://www.dosomethinghere.com/2009/11/24/how-to-get-the-version-number-of-a-running-process/</link>
		<comments>http://www.dosomethinghere.com/2009/11/24/how-to-get-the-version-number-of-a-running-process/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 01:37:47 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=396</guid>
		<description><![CDATA[I wanted to have my .NET based Palm OS conduit DLL be able to report the version of the HotSync Manager that the user has installed on their computer. Initially, I was going to try to read the version of the executable, but then I would first have to find the path to the executable, [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to have my .NET based Palm OS conduit DLL be able to report the version of the HotSync Manager that the user has installed on their computer. Initially, I was going to try to read the version of the executable, but then I would first have to find the path to the executable, and hope that this would be a reliable enough method.</p>
<p>As it turns out, after I did a little investigation, I found out that it is not necessary to try and figure out where the HotSync Manager is installed by reading the appropriate registry key to get the HotSync Manager location and then trying to get the version number of the assembly at that path. Because the user is in the conduit code, the HotSync Manager (HOTSYNC.EXE) is already in the running processes list. It just so happens that in the System.Diagnostics namespace there is a handy dandy method that gets all of the running processes, along with a goodly amount of information about each process, including the version number.</p>
<p>So here is my VB.NET code that searches for the HotSync Manager process and returns the version number as a string.</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Function</span> GetHotSyncVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>
&nbsp;
    <span style="color: #0600FF;">Dim</span> versionString <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Unknown&quot;</span>
&nbsp;
    <span style="color: #0600FF;">Dim</span> procList <span style="color: #FF8000;">As</span> List<span style="color: #000000;">&#40;</span>Of Process<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> Process.<span style="color: #0000FF;">GetProcesses</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ToList</span>
    <span style="color: #0600FF;">Dim</span> hotSyncProcess <span style="color: #FF8000;">As</span> Process <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
    <span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> p In procList
        <span style="color: #0600FF;">If</span> p.<span style="color: #0000FF;">ProcessName</span>.<span style="color: #0000FF;">ToUpper</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;HOTSYNC&quot;</span> <span style="color: #FF8000;">Then</span>
            hotSyncProcess <span style="color: #008000;">=</span> p
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
    <span style="color: #FF8000;">Next</span>
&nbsp;
    <span style="color: #0600FF;">If</span> hotSyncProcess <span style="color: #FF8000;">IsNot</span> <span style="color: #FF8000;">Nothing</span> <span style="color: #FF8000;">Then</span>
        versionString <span style="color: #008000;">=</span> hotSyncProcess.<span style="color: #0000FF;">MainModule</span>.<span style="color: #0000FF;">FileVersionInfo</span>.<span style="color: #0000FF;">FileVersion</span>
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
    <span style="color: #FF8000;">Return</span> versionString
&nbsp;
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>

<p>Sorry I missed the CIDUG meeting tonight.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2009/11/24/how-to-get-the-version-number-of-a-running-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetCFSvcUtil.exe error in Windows 7</title>
		<link>http://www.dosomethinghere.com/2009/10/08/netcfsvcutil-exe-error-in-windows-7/</link>
		<comments>http://www.dosomethinghere.com/2009/10/08/netcfsvcutil-exe-error-in-windows-7/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 17:59:46 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=339</guid>
		<description><![CDATA[I have been using Windows 7 for a while now, and always had to keep my Windows XP dev machine handy to help out with my Windows Mobile software development.
It turns out that the NetCFSvcUtil application included in the .NET CF Power Toys did not get along with Windows 7 (neither the RC or the [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using Windows 7 for a while now, and always had to keep my Windows XP dev machine handy to help out with my Windows Mobile software development.</p>
<p>It turns out that the NetCFSvcUtil application included in the .NET CF Power Toys did not get along with Windows 7 (neither the RC or the RTM bits), as it gave a cryptic error message of &#8220;An error occurred in the tool&#8221;.</p>
<p>So just for giggles, I decided to see if there were any updates, and lo and behold, I found a blog post from Habib Heydarian with an updated application:</p>
<p><a href="http://blogs.msdn.com/habibh/archive/2009/06/26/netcfsvcutil-exe-and-windows-7.aspx" target="_blank">NetCFSvcUtil.exe and Windows 7</a></p>
<p>Now I can happily generate the client code on my Windows 7 machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2009/10/08/netcfsvcutil-exe-error-in-windows-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cannot enable networking in Windows Mobile emulator on Windows 7</title>
		<link>http://www.dosomethinghere.com/2009/10/05/cannot-enable-networking-in-windows-mobile-emulator-on-windows-7/</link>
		<comments>http://www.dosomethinghere.com/2009/10/05/cannot-enable-networking-in-windows-mobile-emulator-on-windows-7/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 14:34:49 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=337</guid>
		<description><![CDATA[So you are using a new Windows 7 installation and developing a Windows Mobile application, and you have been using it just fine on another dev box or in an earlier version of Windows. You deploy your application, and it needs to communicate over the internet, so you go into the Network tab of the Emulator Properties [...]]]></description>
			<content:encoded><![CDATA[<p>So you are using a new Windows 7 installation and developing a Windows Mobile application, and you have been using it just fine on another dev box or in an earlier version of Windows. You deploy your application, and it needs to communicate over the internet, so you go into the Network tab of the Emulator Properties and enable the network adapter.</p>
<p>Only this time, it comes up with an error message about installing Virtual PC 2007.</p>
<p>And then you find out that Virtual PC 2007 does not play nicely with Windows 7.</p>
<p>Well it all has to do with Virtual Machine Network Services. Here is a blog post from Brian Peek on how to solve the problem:</p>
<p><a href="http://www.brianpeek.com/blog/archive/2009/05/02/windows-virtual-pc-and-the-microsoft-device-emulator.aspx" target="_blank">Windows Virtual PC and the Microsoft Device Emulator</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2009/10/05/cannot-enable-networking-in-windows-mobile-emulator-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
