<?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>FlexiCoder Blog &#187; VB.Net</title>
	<atom:link href="http://www.flexicoder.com/blog/index.php/category/vb-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexicoder.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jul 2010 15:11:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>VB.Net &#8211; ControlChars</title>
		<link>http://www.flexicoder.com/blog/index.php/2009/01/vbnet-controlchars/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2009/01/vbnet-controlchars/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 19:14:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[useful links]]></category>
		<category><![CDATA[.Net code]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=20</guid>
		<description><![CDATA[If you need special characters in your VB.Net use the ControlChars class, it has definitions for Lf, Crlf, etc.
See MSDN for more details
Social Bookmarking]]></description>
			<content:encoded><![CDATA[<p>If you need special characters in your VB.Net use the ControlChars class, it has definitions for Lf, Crlf, etc.</p>
<p>See <a href="http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.controlchars_members.aspx">MSDN</a> for more details</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2009/01/vbnet-controlchars/&title=VB.Net+%26%238211%3B+ControlChars&text=If+you+need+special+characters+in+your+VB.Net+use+the+ControlChars+class%2C+it+has+definitions+for+Lf%2C+Crlf%2C+etc.&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2009/01/vbnet-controlchars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrintPreviewControl</title>
		<link>http://www.flexicoder.com/blog/index.php/2008/12/printpreviewcontrol/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2008/12/printpreviewcontrol/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 11:57:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[.Net Printing Controls]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[.Net code]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=17</guid>
		<description><![CDATA[If you are using the PrintPreviewControl and what the page displayed to be refreshed with a new document, you must call the PrintPreviewControl.InvalidatePreview method. In 1.1 this did it automatically everytime a document was set, but now you have to do it manually, thats progress for you!

StatementPrintPreviewControl.Document = aDocument
StatementPrintPreviewControl.InvalidatePreview()

Social Bookmarking]]></description>
			<content:encoded><![CDATA[<p>If you are using the <em>PrintPreviewControl</em> and what the page displayed to be refreshed with a new document, you must call the <em>PrintPreviewControl.InvalidatePreview</em> method. In 1.1 this did it automatically everytime a document was set, but now you have to do it manually, thats progress for you!</p>
<p><code>
<pre class="bush:vb">StatementPrintPreviewControl.Document = aDocument
StatementPrintPreviewControl.InvalidatePreview()</pre>
<p></code></p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2008/12/printpreviewcontrol/&title=PrintPreviewControl&text=If+you+are+using+the+PrintPreviewControl+and+what+the+page+displayed+to+be+refreshed+with+a+new+document%2C+you+must+call+the+PrintPreviewControl.InvalidatePreview+method.+In+1.1+this+did+it...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2008/12/printpreviewcontrol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TryCast &#8211; better than DirectCast?</title>
		<link>http://www.flexicoder.com/blog/index.php/2008/12/trycast-better-than-directcast/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2008/12/trycast-better-than-directcast/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 17:09:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[useful links]]></category>
		<category><![CDATA[.Net code]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=9</guid>
		<description><![CDATA[In VB.Net Framework V2.0 a new command was introduced called TryCast It works the same as DirectCast but if the cast fails instead of throwing an exception the object is set to Nothing
Take a look at MSDN for more details.
Social Bookmarking]]></description>
			<content:encoded><![CDATA[<p>In VB.Net Framework V2.0 a new command was introduced called <em>TryCast</em> It works the same as <em>DirectCast</em> but if the cast fails instead of throwing an exception the object is set to <em>Nothing</em></p>
<p>Take a look at <a href="http://msdn.microsoft.com/en-us/library/zyy863x8.aspx">MSDN</a> for more details.</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2008/12/trycast-better-than-directcast/&title=TryCast+%26%238211%3B+better+than+DirectCast%3F&text=In+VB.Net+Framework+V2.0+a+new+command+was+introduced+called+TryCast+It+works+the+same+as+DirectCast+but+if+the+cast+fails+instead+of+throwing+an+exception+the+object+is+set+to+Nothing+Take+a+look+at...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2008/12/trycast-better-than-directcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrintPreviewDialog &#8211; PrintDialog</title>
		<link>http://www.flexicoder.com/blog/index.php/2008/12/printpreviewdialog-printdialog/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2008/12/printpreviewdialog-printdialog/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 15:59:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[.Net code]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=8</guid>
		<description><![CDATA[Ok so this might be an obvious one but it got me stuck for a little while so thought I should post it. When you use the PrintPreviewDialog the documents Print method is automatically called when the dialog is shown. But using the PrintDialog the Print method of the associated PrintDocument is not called when [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so this might be an obvious one but it got me stuck for a little while so thought I should post it. When you use the <em>PrintPreviewDialog</em> the documents <em>Print</em> method is automatically called when the dialog is shown. But using the <em>PrintDialog</em> the <em>Print</em> method of the associated <em>PrintDocument</em> is not called when the user clicks the <em>Print</em> button on the dialog, you have to check that OK was returned as the dialogs result!</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2008/12/printpreviewdialog-printdialog/&title=PrintPreviewDialog+%26%238211%3B+PrintDialog&text=Ok+so+this+might+be+an+obvious+one+but+it+got+me+stuck+for+a+little+while+so+thought+I+should+post+it.&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2008/12/printpreviewdialog-printdialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DataGridView CheckBox Value</title>
		<link>http://www.flexicoder.com/blog/index.php/2008/12/datagridview-checkbox-value/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2008/12/datagridview-checkbox-value/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 13:49:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[.Net code]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=7</guid>
		<description><![CDATA[There are a few gotchas with checking the value of a CheckBox in a DataGridView. You can use the CellValueChanged event, the bound object will have been updated so its easy to check&#8230;


Private Sub PaymentsDataGridView_CellValueChanged(ByVal sender As System.Object, _
            ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) _
 [...]]]></description>
			<content:encoded><![CDATA[<p>There are a few gotchas with checking the value of a <em>CheckBox </em>in a <em>DataGridView</em>. You can use the <em>CellValueChanged </em>event, the bound object will have been updated so its easy to check&#8230;</p>
<p><code>
<pre class="brush:vb">
Private Sub PaymentsDataGridView_CellValueChanged(ByVal sender As System.Object, _
            ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) _
                Handles PaymentsDataGridView.CellValueChanged
    'This code will be called while loading the grid as well so I
    'just check for it by setting a flag
    If Not _Loading AndAlso e.ColumnIndex = 4 AndAlso e.RowIndex >= 0 Then
        Dim aSummary As RebatePatientSummary = _
                DirectCast(PaymentsDataGridView.Rows(e.RowIndex).DataBoundItem, _
                        RebatePatientSummary)
        If aSummary.PrintMe Then
            _PrintCount += 1
        Else
            _PrintCount -= 1
        End If
        AvailableToPrintLabel.Text = "Selected for printing : " &#038; _PrintCount
     End If
End Sub</pre>
<p></code></p>
<p>That gotcha here though is that the event is only fired once the cell has lost focus!</p>
<p>You can use the <em>CurrentCellDirtyStateChanged</em> but that only fires once so if the user clicks the checkbox multiple times you don&#8217;t actually know the final state</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2008/12/datagridview-checkbox-value/&title=DataGridView+CheckBox+Value&text=There+are+a+few+gotchas+with+checking+the+value+of+a+CheckBox+in+a+DataGridView.+You+can+use+the+CellValueChanged+event%2C+the+bound+object+will+have+been+updated+so+its+easy+to+check%26%238230%3B+++Private...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2008/12/datagridview-checkbox-value/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrintDocument, PrintPreviewDialog and Multiple Pages</title>
		<link>http://www.flexicoder.com/blog/index.php/2008/12/printdocument-printpreviewdialog-and-multiple-pages/</link>
		<comments>http://www.flexicoder.com/blog/index.php/2008/12/printdocument-printpreviewdialog-and-multiple-pages/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 11:03:00 +0000</pubDate>
		<dc:creator>flexicoder</dc:creator>
				<category><![CDATA[.Net Printing Controls]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[.Net code]]></category>

		<guid isPermaLink="false">http://www.flexicoder.com/blog/?p=6</guid>
		<description><![CDATA[If you are generating multiple pages in a document you set the e.HasMorePages to true, normally this is done by checking how many pages you have to print, e.g.


_CurrentPageNumber += 1
e.HasMorePages = _CurrentPageNumber

If the user then decides to Print the pages they are likely to only see the first page because the _CurrentPageNumber has not [...]]]></description>
			<content:encoded><![CDATA[<p>If you are generating multiple pages in a document you set the<span style="font-family:courier new;"><strong> e.HasMorePages</strong></span> to true, normally this is done by checking how many pages you have to print, e.g.</p>
<p><code>
<pre class="brush:vb">
_CurrentPageNumber += 1
e.HasMorePages = _CurrentPageNumber
</pre>
<p></code><br />If the user then decides to Print the pages they are likely to only see the first page because the _CurrentPageNumber has not been reset to zero, as the Print command actually regenerates the pages by firing your code again not using what it has already created.</p>
<p>The tip here is to reset the controlling counter in the <span style="font-family:courier new;"><strong>BeginPrint</strong></span> event</p>
<br/><a href="http://www.socialmarker.com/?link=http://www.flexicoder.com/blog/index.php/2008/12/printdocument-printpreviewdialog-and-multiple-pages/&title=PrintDocument%2C+PrintPreviewDialog+and+Multiple+Pages&text=If+you+are+generating+multiple+pages+in+a+document+you+set+the+e.HasMorePages+to+true%2C+normally+this+is+done+by+checking+how+many+pages+you+have+to+print%2C+e.g.+++_CurrentPageNumber+%2B%3D+1...&tags=" target="_blank"><img src= "http://www.socialmarker.com/bookmark.gif" border="0" /></a><noscript><a href="http://www.socialmarker.com" >Social Bookmarking</a></noscript>]]></content:encoded>
			<wfw:commentRss>http://www.flexicoder.com/blog/index.php/2008/12/printdocument-printpreviewdialog-and-multiple-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
