sender Is (control) with Option Strict On

 
Select Case True
    Case sender Is PrintPreviewToolStripMenuItem, sender Is PrintPreviewToolStripButton
 
From
You can use Select Case as in the following:

Select Case True
   Case sender Is TextBox1
      Label1.Text = TextBox1.Text
  
Case sender Is TextBox2
      Label1.Text = TextBox2.Text
End Select

However, this translates into IL (and decompiled using Reflector) as:

 Dim flag1 As Boolean = True
      If (flag1 = (sender Is Me.TextBox1)) Then
            Me.Label1.Text = Me.TextBox1.Text
      Else
            If (flag1 = (sender Is Me.TextBox2)) Then
                  Me.Label1.Text = Me.TextBox2.Text
            End If
      End If

I don’t know if this helps.

METHOD How to set a Local Report Parameter

 

They said it could not be done.
But here is the code to set a Local Report Parameter at runtime

”’ <summary>
”’ METHOD How to set Report Parameter
”’ </summary>
”’ <param name="MyReportViewer"></param>
”’ <param name="sParameterName"></param>
”’ <param name="sParameterText"></param>
”’ <remarks></remarks>

Private Sub SetLocalReportParameter(ByVal MyReportViewer As Microsoft.Reporting.WinForms.ReportViewer, ByVal sParameterName As String, ByVal sParameterText As String)

Try
Dim rp As New ReportParameter(sParameterName, sParameterText)
Dim rpP() As ReportParameter = {rp}
With MyReportViewer
.LocalReport.SetParameters(rpP)
.RefreshReport()
End With

Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

End Sub

Talking about Tip/Trick: Hard Drive Speed and Visual Studio Performance – ScottGu’s Blog

 
 
 
Importance of Hard Disk Speed on new PC / Laptop especially for Visual Studio 2008
Edited from Windows Live Writer