Dual Monitor screen saver fail - vb.net

I am attempting to make a dual screen screen saver. It was working at the beginning but now it isn't working. Here is the start up function:
Sub Main()
Dim x = 0
For Each screen As Screen In screen.AllScreens
Dim screensaver As ScrSav = New ScrSav(screen.Bounds)
screensaver.Location = screen.Bounds.Location
screensaver.Show()
x += 1
Debug.Print(screen.Bounds.Left & " " & screen.Bounds.Top & " " & screen.Bounds.Width & " " & screen.Bounds.Height & " " & "")
Next
Application.Run()
End Sub
and here is the form code
Public Class ScrSav
Public Sub New()
InitializeComponent()
End Sub
Public Sub New(xBounds As Rectangle)
InitializeComponent()
Me.Bounds = xBounds
Debug.Print(Me.Bounds.Left & " " & Me.Bounds.Top & " " & Me.Bounds.Width & " " & Me.Bounds.Height & " " & "")
Cards.Location = New Point((Me.Width - Cards.Width) / 2, (Me.Height - Cards.Height) / 2)
Header.Location = New Point((Me.Width - Header.Width) / 2, 0)
Cards.Navigate("http://pah.guycothal.com/screensaver.aspx")
End Sub
Protected Overrides Sub Finalize()
MyBase.Finalize()
End
End Sub
Private Sub ScrSav_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
End
End Sub
End Class
What am i doing wrong???
I am initializing the 2 screen the way others are. in fact, i have a few places where I have put debugging in place to see what is going on in each of the subs. here is what is it outputting
0 0 1280 800 <--main
0 0 1280 800 <--new
1280 -224 1280 1024 <-main
1280 -224 1280 1024 <-new
I have labeled which sub each is from to make it easier to understand. Also, here is what is on the form itself
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class ScrSav
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ScrSav))
Me.Cards = New System.Windows.Forms.WebBrowser()
Me.Header = New System.Windows.Forms.PictureBox()
CType(Me.Header, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Cards
'
Me.Cards.AllowNavigation = False
Me.Cards.AllowWebBrowserDrop = False
Me.Cards.IsWebBrowserContextMenuEnabled = False
Me.Cards.Location = New System.Drawing.Point(128, 137)
Me.Cards.MaximumSize = New System.Drawing.Size(640, 200)
Me.Cards.MinimumSize = New System.Drawing.Size(640, 200)
Me.Cards.Name = "Cards"
Me.Cards.ScriptErrorsSuppressed = True
Me.Cards.ScrollBarsEnabled = False
Me.Cards.Size = New System.Drawing.Size(640, 200)
Me.Cards.TabIndex = 0
Me.Cards.TabStop = False
Me.Cards.Url = New System.Uri("http://pah.guycothal.com/screensaver.aspx", System.UriKind.Absolute)
Me.Cards.WebBrowserShortcutsEnabled = False
'
'Header
'
Me.Header.Image = CType(resources.GetObject("Header.Image"), System.Drawing.Image)
Me.Header.InitialImage = CType(resources.GetObject("Header.InitialImage"), System.Drawing.Image)
Me.Header.Location = New System.Drawing.Point(0, 0)
Me.Header.MaximumSize = New System.Drawing.Size(2000, 60)
Me.Header.MinimumSize = New System.Drawing.Size(2000, 60)
Me.Header.Name = "Header"
Me.Header.Size = New System.Drawing.Size(2000, 60)
Me.Header.TabIndex = 1
Me.Header.TabStop = False
'
'ScrSav
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.Black
Me.ClientSize = New System.Drawing.Size(991, 453)
Me.Controls.Add(Me.Header)
Me.Controls.Add(Me.Cards)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Name = "ScrSav"
Me.ShowInTaskbar = False
Me.Text = "ScrSav"
Me.TopMost = True
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
CType(Me.Header, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents Cards As System.Windows.Forms.WebBrowser
Friend WithEvents Header As System.Windows.Forms.PictureBox
End Class

Related

Displaying file properties

Is possible to display file properties with full path and date. I would like to add file size and/or hash value of the file to the output (if possible) the data will be written to a text file not done yet I want to get the basic operation working first. This will be used as a file monitor for USB drives when all is said and done.
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
Private WithEvents objWatcher As New clsFSW()
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents cmdStart As System.Windows.Forms.Button
Friend WithEvents cmdStop As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents txtFolder As System.Windows.Forms.TextBox
Friend WithEvents chkSubFolders As System.Windows.Forms.CheckBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.cmdStart = New System.Windows.Forms.Button()
Me.cmdStop = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtFolder = New System.Windows.Forms.TextBox()
Me.chkSubFolders = New System.Windows.Forms.CheckBox()
Me.SuspendLayout()
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(32, 8)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.TextBox1.Size = New System.Drawing.Size(392, 240)
Me.TextBox1.TabIndex = 0
Me.TextBox1.Text = ""
'
'cmdStart
'
Me.cmdStart.Location = New System.Drawing.Point(120, 336)
Me.cmdStart.Name = "cmdStart"
Me.cmdStart.TabIndex = 1
Me.cmdStart.Text = "Start Watch"
'
'cmdStop
'
Me.cmdStop.Location = New System.Drawing.Point(216, 336)
Me.cmdStop.Name = "cmdStop"
Me.cmdStop.TabIndex = 2
Me.cmdStop.Text = "Stop Watch"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(6, 272)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(93, 13)
Me.Label1.TabIndex = 3
Me.Label1.Text = "Folder to Monitor:"
'
'txtFolder
'
Me.txtFolder.Location = New System.Drawing.Point(110, 272)
Me.txtFolder.Name = "txtFolder"
Me.txtFolder.Size = New System.Drawing.Size(184, 20)
Me.txtFolder.TabIndex = 4
Me.txtFolder.Text = ""
'
'chkSubFolders
'
Me.chkSubFolders.Location = New System.Drawing.Point(312, 272)
Me.chkSubFolders.Name = "chkSubFolders"
Me.chkSubFolders.Size = New System.Drawing.Size(128, 24)
Me.chkSubFolders.TabIndex = 6
Me.chkSubFolders.Text = "Include Subfolders"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(464, 373)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.chkSubFolders, Me.txtFolder, Me.Label1, Me.cmdStop, Me.cmdStart, Me.TextBox1})
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "File System Watcher Class Demo"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmdStop.Enabled = False
With objWatcher
End With
End Sub
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click
Dim sDir As String
sDir = txtFolder.Text
If IO.Directory.Exists(sDir) Then
objWatcher.FolderToMonitor = sDir
objWatcher.StartWatch()
cmdStop.Enabled = True
cmdStart.Enabled = True
chkSubFolders.Enabled = True
Else
MessageBox.Show("Folder does not exist!")
End If
End Sub
Private Sub cmdStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStop.Click
objWatcher.StopWatch()
cmdStop.Enabled = True
cmdStart.Enabled = True
chkSubFolders.Enabled = True
End Sub
Private Sub chkSubFolders_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkSubFolders.CheckedChanged
objWatcher.IncludeSubfolders = (chkSubFolders.Checked = True)
End Sub
Private Sub objWatcher_FileCreated(ByVal FullPath As String) Handles objWatcher.FileCreated
TextBox1.Text &= "File Created: " & FullPath & ", " & DateString & vbCrLf
End Sub
Private Sub objWatcher_FileChanged(ByVal FullPath As String) Handles objWatcher.FileChanged
TextBox1.Text &= "File Changed: " & FullPath & ", " & DateString & vbCrLf
End Sub
Private Sub objWatcher_FileDeleted(ByVal FullPath As String) Handles objWatcher.FileDeleted
TextBox1.Text &= "File Deleted: " & FullPath & ", " & DateString & vbCrLf
End Sub
Private Sub objWatcher_FileRenamed(ByVal OldFileName As String, ByVal newFileName As String) Handles objWatcher.FileRenamed
TextBox1.Text &= "File Rename: " & OldFileName & " to " & newFileName & ", " & DateString & vbCrLf
End Sub
Private Sub objWatcher_FileWatchError(ByVal ErrMsg As String) Handles objWatcher.FileWatchError
TextBox1.Text &= "The following error occurred: " & ErrMsg & vbCrLf
End Sub
End Class

I've trying to make a simple application in visual basic.NET,

I'm new to Visual Basic.NET and I've been trying to make this simple application. It's a tax calculator.
Two-dimensional arrays are a bit... well not easy for me to grasp yet. So my question is: can you take a look at my code and give me hints on how to solve this issue?
When I run the code in the Labelbox I get a result of 0.00
Public Class PerrytownForm
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'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
Friend WithEvents IdFwtLabel As System.Windows.Forms.Label
Friend WithEvents FwtLabel As System.Windows.Forms.Label
Friend WithEvents CalculateButton As System.Windows.Forms.Button
Friend WithEvents ExitButton As System.Windows.Forms.Button
Friend WithEvents StatusGroupBox As System.Windows.Forms.GroupBox
Friend WithEvents MarriedRadioButton As System.Windows.Forms.RadioButton
Friend WithEvents SingleRadioButton As System.Windows.Forms.RadioButton
Friend WithEvents IdTaxableLabel As System.Windows.Forms.Label
Friend WithEvents TaxableTextBox As System.Windows.Forms.TextBox
'Required by the Windows Form Designer
Private components As System.ComponentModel.Container
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.IdTaxableLabel = New System.Windows.Forms.Label()
Me.StatusGroupBox = New System.Windows.Forms.GroupBox()
Me.MarriedRadioButton = New System.Windows.Forms.RadioButton()
Me.SingleRadioButton = New System.Windows.Forms.RadioButton()
Me.TaxableTextBox = New System.Windows.Forms.TextBox()
Me.IdFwtLabel = New System.Windows.Forms.Label()
Me.FwtLabel = New System.Windows.Forms.Label()
Me.CalculateButton = New System.Windows.Forms.Button()
Me.ExitButton = New System.Windows.Forms.Button()
Me.StatusGroupBox.SuspendLayout()
Me.SuspendLayout()
'
'IdTaxableLabel
'
Me.IdTaxableLabel.AutoSize = True
Me.IdTaxableLabel.Location = New System.Drawing.Point(24, 24)
Me.IdTaxableLabel.Name = "IdTaxableLabel"
Me.IdTaxableLabel.Size = New System.Drawing.Size(99, 16)
Me.IdTaxableLabel.TabIndex = 0
Me.IdTaxableLabel.Text = "&Taxable wages:"
'
'StatusGroupBox
'
Me.StatusGroupBox.Controls.Add(Me.MarriedRadioButton)
Me.StatusGroupBox.Controls.Add(Me.SingleRadioButton)
Me.StatusGroupBox.Location = New System.Drawing.Point(184, 24)
Me.StatusGroupBox.Name = "StatusGroupBox"
Me.StatusGroupBox.Size = New System.Drawing.Size(95, 88)
Me.StatusGroupBox.TabIndex = 2
Me.StatusGroupBox.TabStop = False
Me.StatusGroupBox.Text = "Status"
'
'MarriedRadioButton
'
Me.MarriedRadioButton.Checked = True
Me.MarriedRadioButton.Location = New System.Drawing.Point(8, 21)
Me.MarriedRadioButton.Name = "MarriedRadioButton"
Me.MarriedRadioButton.Size = New System.Drawing.Size(80, 24)
Me.MarriedRadioButton.TabIndex = 0
Me.MarriedRadioButton.TabStop = True
Me.MarriedRadioButton.Text = "&Married"
'
'SingleRadioButton
'
Me.SingleRadioButton.Location = New System.Drawing.Point(8, 50)
Me.SingleRadioButton.Name = "SingleRadioButton"
Me.SingleRadioButton.Size = New System.Drawing.Size(80, 24)
Me.SingleRadioButton.TabIndex = 1
Me.SingleRadioButton.Text = "&Single"
'
'TaxableTextBox
'
Me.TaxableTextBox.Location = New System.Drawing.Point(24, 40)
Me.TaxableTextBox.Name = "TaxableTextBox"
Me.TaxableTextBox.Size = New System.Drawing.Size(136, 23)
Me.TaxableTextBox.TabIndex = 1
'
'IdFwtLabel
'
Me.IdFwtLabel.AutoSize = True
Me.IdFwtLabel.Location = New System.Drawing.Point(24, 80)
Me.IdFwtLabel.Name = "IdFwtLabel"
Me.IdFwtLabel.Size = New System.Drawing.Size(146, 16)
Me.IdFwtLabel.TabIndex = 5
Me.IdFwtLabel.Text = "Federal withholding tax:"
'
'FwtLabel
'
Me.FwtLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.FwtLabel.Location = New System.Drawing.Point(24, 96)
Me.FwtLabel.Name = "FwtLabel"
Me.FwtLabel.Size = New System.Drawing.Size(136, 23)
Me.FwtLabel.TabIndex = 6
Me.FwtLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'CalculateButton
'
Me.CalculateButton.Location = New System.Drawing.Point(184, 120)
Me.CalculateButton.Name = "CalculateButton"
Me.CalculateButton.Size = New System.Drawing.Size(96, 25)
Me.CalculateButton.TabIndex = 3
Me.CalculateButton.Text = "&Calculate Tax"
'
'ExitButton
'
Me.ExitButton.Location = New System.Drawing.Point(184, 152)
Me.ExitButton.Name = "ExitButton"
Me.ExitButton.Size = New System.Drawing.Size(96, 25)
Me.ExitButton.TabIndex = 4
Me.ExitButton.Text = "E&xit"
'
'PerrytownForm
'
Me.AcceptButton = Me.CalculateButton
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 16)
Me.ClientSize = New System.Drawing.Size(312, 205)
Me.Controls.Add(Me.StatusGroupBox)
Me.Controls.Add(Me.ExitButton)
Me.Controls.Add(Me.CalculateButton)
Me.Controls.Add(Me.FwtLabel)
Me.Controls.Add(Me.IdFwtLabel)
Me.Controls.Add(Me.TaxableTextBox)
Me.Controls.Add(Me.IdTaxableLabel)
Me.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "PerrytownForm"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Perrytown Gift Shop"
Me.StatusGroupBox.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
'declare form-level arrays
Private msngSingle(,) As Single = {{51, 0, 0, 0},
{552, 0, 0.15, 51},
{1196, 75.15, 0.28, 552},
{2662, 255.47, 0.31, 1196},
{5750, 709.93, 0.36, 2662},
{99999, 1821.61, 0.396, 5750}}
Private msngMarried(,) As Single = {{124, 0, 0, 0},
{960, 0, 0.15, 124},
{2023, 124.4, 0.28, 960},
{3292, 423.04, 0.31, 2023},
{5809, 816.43, 0.36, 3292},
{99999, 1722.55, 0.396, 5809}}
Private Sub ExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Me.Close()
End Sub
Private Sub TaxableTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TaxableTextBox.Enter
Me.TaxableTextBox.SelectAll()
End Sub
Private Sub ClearLabels(ByVal sender As Object, ByVal e As System.EventArgs) Handles MarriedRadioButton.Click, SingleRadioButton.Click, TaxableTextBox.TextChanged
Me.FwtLabel.Text = ""
End Sub
Private Sub CalculateButton_Click(sender As Object, e As EventArgs) Handles CalculateButton.Click
Dim sngTaxTable(5, 3) As Single
Dim sngTaxable, sngFwt As Single, intRow As Integer
Dim blnFound As Boolean
'assign taxable wages to a variable
sngTaxable = Val(Me.TaxableTextBox.Text)
'determine appropriate array
If Me.SingleRadioButton.Checked = True Then
sngTaxable = msngSingle
Else
sngTaxable = msngMarried
End If
'search for taxable wages in the first column in the array
Do While intRow < 6 AndAlso blnFound = False
If sngTaxable <= sngTaxTable(intRow, 0) Then
'calculate the fwt
sngFwt = sngTaxTable(intRow, 1) _
+ sngTaxTable(intRow, 2) _
* (sngTaxable - sngTaxTable(intRow, 3))
blnFound = True
Else
intRow = intRow + 1
End If
Loop
'display the fwt
Me.FwtLabel.Text = Format(sngFwt, "currency")
End Sub
End Class
I tried the code for myself and found some mistake: You forgot the letter "T"
If Me.SingleRadioButton.Checked = True Then
sngTaxable = msngSingle
Else
sngTaxable = msngMarried
End If
needs to be
If Me.SingleRadioButton.Checked = True Then
sngTaxTable = msngSingle
Else
sngTaxTable = msngMarried
End If
If I change this, the code will work and give some results, if I try to enter some numbers.
If they are too little or big, the program doesn't do anything. I don't know if this is intentional, but maybe a little error output (MsgBox etc) could be nice.

Using PC name by default

I finished my Chat over LAN project and everything work great,
but i have problem here,I don't want users put their name every time they want to send msgs over LAN, I want the program use the PC name by default, so in chat section the PC name will appear automatically, Can someone help me in this!
& this is my code
Imports System.DirectoryServices
Imports System.Net
Imports System.IO
Imports System.Net.Sockets
Imports MSTSCLib
Public Class frmMain
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TreeView1 As System.Windows.Forms.TreeView
Friend WithEvents txtPCName As System.Windows.Forms.TextBox
Friend WithEvents txtSend As System.Windows.Forms.TextBox
Friend WithEvents CmdSend As System.Windows.Forms.Button
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents txtPCIPadd As System.Windows.Forms.TextBox
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents txtUsername As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents txtConversation As System.Windows.Forms.TextBox
Friend WithEvents txttempmsg As System.Windows.Forms.TextBox
Friend WithEvents Label2 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain))
Me.CmdSend = New System.Windows.Forms.Button()
Me.TreeView1 = New System.Windows.Forms.TreeView()
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
Me.txtPCName = New System.Windows.Forms.TextBox()
Me.txtSend = New System.Windows.Forms.TextBox()
Me.txtPCIPadd = New System.Windows.Forms.TextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.txtUsername = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.txtConversation = New System.Windows.Forms.TextBox()
Me.txttempmsg = New System.Windows.Forms.TextBox()
Me.SuspendLayout()
'
'CmdSend
'
Me.CmdSend.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.CmdSend.Location = New System.Drawing.Point(404, 265)
Me.CmdSend.Name = "CmdSend"
Me.CmdSend.Size = New System.Drawing.Size(55, 52)
Me.CmdSend.TabIndex = 0
Me.CmdSend.Text = "&Send"
'
'TreeView1
'
Me.TreeView1.ImageIndex = 0
Me.TreeView1.ImageList = Me.ImageList1
Me.TreeView1.Location = New System.Drawing.Point(291, 10)
Me.TreeView1.Name = "TreeView1"
Me.TreeView1.SelectedImageIndex = 0
Me.TreeView1.Size = New System.Drawing.Size(168, 234)
Me.TreeView1.TabIndex = 1
'
'ImageList1
'
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
Me.ImageList1.Images.SetKeyName(0, "")
'
'txtPCName
'
Me.txtPCName.Location = New System.Drawing.Point(108, 34)
Me.txtPCName.Name = "txtPCName"
Me.txtPCName.ReadOnly = True
Me.txtPCName.Size = New System.Drawing.Size(136, 20)
Me.txtPCName.TabIndex = 2
'
'txtSend
'
Me.txtSend.Location = New System.Drawing.Point(12, 266)
Me.txtSend.Multiline = True
Me.txtSend.Name = "txtSend"
Me.txtSend.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.txtSend.Size = New System.Drawing.Size(386, 52)
Me.txtSend.TabIndex = 3
'
'txtPCIPadd
'
Me.txtPCIPadd.Location = New System.Drawing.Point(108, 58)
Me.txtPCIPadd.Name = "txtPCIPadd"
Me.txtPCIPadd.Size = New System.Drawing.Size(136, 20)
Me.txtPCIPadd.TabIndex = 6
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(13, 59)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(71, 15)
Me.Label2.TabIndex = 7
Me.Label2.Text = "IP Address :"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(12, 247)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(58, 15)
Me.Label3.TabIndex = 9
Me.Label3.Text = "Message"
'
'Timer1
'
'
'txtUsername
'
Me.txtUsername.Location = New System.Drawing.Point(108, 10)
Me.txtUsername.Name = "txtUsername"
Me.txtUsername.Size = New System.Drawing.Size(136, 20)
Me.txtUsername.TabIndex = 10
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(13, 14)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(70, 15)
Me.Label4.TabIndex = 11
Me.Label4.Text = "Your name:"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(13, 35)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(44, 15)
Me.Label5.TabIndex = 12
Me.Label5.Text = "Buddy:"
'
'txtConversation
'
Me.txtConversation.BackColor = System.Drawing.Color.White
Me.txtConversation.Location = New System.Drawing.Point(15, 84)
Me.txtConversation.Multiline = True
Me.txtConversation.Name = "txtConversation"
Me.txtConversation.ReadOnly = True
Me.txtConversation.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.txtConversation.Size = New System.Drawing.Size(270, 160)
Me.txtConversation.TabIndex = 14
'
'txttempmsg
'
Me.txttempmsg.Enabled = False
Me.txttempmsg.Location = New System.Drawing.Point(12, 342)
Me.txttempmsg.Multiline = True
Me.txttempmsg.Name = "txttempmsg"
Me.txttempmsg.Size = New System.Drawing.Size(212, 23)
Me.txttempmsg.TabIndex = 15
Me.txttempmsg.Visible = False
'
'frmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.ButtonFace
Me.ClientSize = New System.Drawing.Size(471, 329)
Me.Controls.Add(Me.txttempmsg)
Me.Controls.Add(Me.txtConversation)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.txtUsername)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.txtPCIPadd)
Me.Controls.Add(Me.txtSend)
Me.Controls.Add(Me.txtPCName)
Me.Controls.Add(Me.TreeView1)
Me.Controls.Add(Me.CmdSend)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmMain"
Me.Text = "KiWi Messenger"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Dim listerner As New TcpListener(44444)
Dim client As TcpClient
Dim client2 As TcpClient
Dim message As String = ""
Dim tts As Object
Dim Sound As New System.Media.SoundPlayer()
Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
listerner.Stop()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TextBox1.Selectionstart = TextBox1.TextLength
'TextBox1.ScrollToCaret()
Dim childEntry As DirectoryEntry
Dim ParentEntry As New DirectoryEntry()
Try
ParentEntry.Path = "WinNT:"
For Each childEntry In ParentEntry.Children
Dim newNode As New TreeNode(childEntry.Name)
Select Case childEntry.SchemaClassName
Case "Domain"
Dim ParentDomain As New TreeNode(childEntry.Name)
TreeView1.Nodes.AddRange(New TreeNode() {ParentDomain})
Dim SubChildEntry As DirectoryEntry
Dim SubParentEntry As New DirectoryEntry()
SubParentEntry.Path = "WinNT://" & childEntry.Name
For Each SubChildEntry In SubParentEntry.Children
Dim newNode1 As New TreeNode(SubChildEntry.Name)
Select Case SubChildEntry.SchemaClassName
Case "Computer"
ParentDomain.Nodes.Add(newNode1)
End Select
Next
End Select
Next
Catch Excep As Exception
MsgBox("Error While Reading Directories")
Finally
ParentEntry = Nothing
End Try
listerner.Start()
Timer1.Enabled = True
Timer1.Start()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmdSend.Click
' Shell("net send " & txtcomputer.Text & " " & txtmessage.Text)
Try
If txtPCIPadd.Text = "" Or txtUsername.Text = "" Or txtSend.Text = "" Then
MsgBox("Sorry Incomplete data")
Else
client = New TcpClient(txtPCIPadd.Text, 44444)
Dim writer As New StreamWriter(client.GetStream())
txttempmsg.Text = (txtSend.Text)
writer.Write(txtUsername.Text + " says: " + txtSend.Text)
txtConversation.Text = (txtConversation.Text + txtUsername.Text + " says: " + txttempmsg.Text + vbCrLf)
'txtmsg.Text="You:" + txtmessage.Text)
writer.Flush()
txtSend.Text = ""
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
txtPCName.Text = TreeView1.SelectedNode.Text
txtPCIPadd.Text = GetIPAddress(txtPCName.Text)
End Sub
Function GetIPAddress(ByVal CompName As String) As String
Dim oAddr As System.Net.IPAddress
Dim sAddr As String
Try
With System.Net.Dns.GetHostByName(CompName)
oAddr = New System.Net.IPAddress(.AddressList(0).Address)
sAddr = oAddr.ToString
End With
GetIPAddress = sAddr
Catch Excep As Exception
MsgBox(Excep.Message, MsgBoxStyle.OkOnly, "Lan Messenger")
Finally
End Try
End Function
Private Sub CmdPing_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Shell("PING " & txtPCIPadd.Text)
End Sub
'Shell("net send ALL " & txtmessage.Text)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
If listerner.Pending = True Then
message = ""
client = listerner.AcceptTcpClient
Dim reader As New StreamReader(client.GetStream())
While reader.Peek > -1
message = message + Convert.ToChar(reader.Read()).ToString
End While
Me.Focus()
txtConversation.Text = (txtConversation.Text + message + vbCrLf)
txtConversation.SelectionStart = txtConversation.TextLength
txtConversation.ScrollToCaret()
'txtmsg.Text="You:" + txtmessage.Text)
My.Computer.Audio.Play(My.Resources.alert, AudioPlayMode.Background)
Sound.Load()
Sound.Play()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Function c() As String
Throw New NotImplementedException
End Function
Private Sub txtUsername_TextChanged(sender As Object, e As EventArgs) Handles txtUsername.TextChanged
End Sub
End Class
You can retrieve the computer's name by using
System.Environment.MachineName
...of which you can assign to a variable, which in your instance would be:
txtUsername.Text = System.Environment.MachineName
Alternatively if you like doing things the long-winded way, you can use the WMI (Windows Management Instrumentation), as per se:
Dim details() As String = {"Name"}
Dim wmiItems As Dictionary(Of String, String)
wmiItems = WMI.GetWMISettingsDictionary("Win32_ComputerSystem", details)
For Each kvp As KeyValuePair(Of String, String) In wmiItems
txtUsername.Text = kvp.Value
Next
You can also get other system information in the same way, such as the make and model; refer to the documentation for this.
To use WMI you must refer to the System.Management library, place the following at the top of the code file:
Imports System.Management

Converted test code generates an error (C# to VB.Net)

I have converted a C# code to VB.net and have applied the small adjustments required.
But when I test the code, it generates an error at the point where these instructions are:
If Not capture.Cued Then
capture.Filename = counter & ".wmv"
I am no expert in DirectShow and I need that code to continue learning. Please Could anyone give me their generous help?
I would appreciate any help. Thank you.
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports DirectX.Capture
Imports DShowNET
Public Class MyWebCam
Inherits Form
' Muaz Khan (#muazkh) - http://muaz-khan.blogspot.com
Private capture As Capture = Nothing
Private filters As Filters = Nothing
Private counter As Integer = 1
Private timer As New Timer()
Private deviceNumber As Integer = 0
Public Sub New()
InitializeComponent()
End Sub
'============================================================================
Private Sub Form1_Shown(sender As Object, e As EventArgs)
filters = New Filters()
If filters.VideoInputDevices IsNot Nothing Then
Try
preview(deviceNumber)
Catch ex As Exception
MessageBox.Show("Maybe any other software is already using your WebCam." & vbLf & vbLf & " Error Message: " & vbLf & vbLf & ex.Message)
End Try
Else
btnStartVideoCapture.Enabled = False
MessageBox.Show("No video device connected to your PC!")
End If
timer.Interval = 600000
' 10 minutes!
AddHandler timer.Tick, Function(obj, evt)
If btnStartVideoCapture.Text = "STOP" Then
counter += 1
If capture IsNot Nothing AndAlso counter > 1 Then
capture.[Stop]()
If Not capture.Cued Then
capture.Filename = counter & ".wmv"
End If
capture.Cue()
capture.Start()
End If
End If
End Function
If filters.VideoInputDevices IsNot Nothing Then
For i = 0 To filters.VideoInputDevices.Count - 1
Dim device = filters.VideoInputDevices(i)
Dim btn = New Button()
btn.Text = i.ToString()
btn.ForeColor = Color.White
btn.BackColor = Color.DarkSlateBlue
btn.Width = 25
AddHandler btn.Click, Function(obj, evt)
Dim thisButton = DirectCast(obj, Button)
If Integer.Parse(thisButton.Text) <> deviceNumber Then
If capture IsNot Nothing Then
capture.Dispose()
capture.[Stop]()
capture.PreviewWindow = Nothing
End If
deviceNumber = Integer.Parse(thisButton.Text)
preview(deviceNumber)
End If
End Function
FlowLayoutPanel1.Controls.Add(btn)
Next
End If
End Sub
'============================================================================
Private Sub preview(deviceNo As Integer)
Try
' MessageBox.Show("deviceNo = > " + deviceNo);
capture = New Capture(filters.VideoInputDevices(deviceNo), filters.AudioInputDevices(0))
capture.PreviewWindow = Panel1
If btnStartVideoCapture.Text = "STOP" Then
counter += 1
If Not capture.Cued Then
capture.Filename = counter & ".wmv"
End If
capture.Cue()
End If
capture.Start()
Catch
End Try
End Sub
'============================================================================
Private Sub btnStartVideoCapture_Click(sender As System.Object, e As System.EventArgs) Handles btnStartVideoCapture.Click
startOrStopCapturing(capture)
End Sub
'============================================================================
Private Sub startOrStopCapturing(capture As Capture)
btnStartVideoCapture.Visible = False
'**** THE ERROR BEGINS TO APPEAR HERE ************
'****
'****
If capture IsNot Nothing Then
capture.[Stop]()
End If
If timer.Enabled Then
timer.[Stop]()
End If
If btnStartVideoCapture.Text = "START" Then
btnStartVideoCapture.Text = "STOP"
btnStartVideoCapture.BackColor = Color.Maroon
Try
If Not capture.Cued Then
capture.Filename = counter & ".wmv"
End If
capture.Cue()
capture.Start()
timer.Start()
Catch ex As Exception
MessageBox.Show("Error Message: " & vbLf & vbLf & ex.Message)
End Try
Else
btnStartVideoCapture.Text = "START"
btnStartVideoCapture.BackColor = Color.DarkSlateBlue
End If
btnStartVideoCapture.Visible = True
End Sub
'============================================================================
Private Sub InitializeComponent()
Me.btnStartVideoCapture = New System.Windows.Forms.Button()
Me.FlowLayoutPanel1 = New System.Windows.Forms.FlowLayoutPanel()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.SuspendLayout()
'
'btnStartVideoCapture
'
Me.btnStartVideoCapture.BackColor = System.Drawing.Color.DarkSlateBlue
Me.btnStartVideoCapture.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnStartVideoCapture.ForeColor = System.Drawing.Color.White
Me.btnStartVideoCapture.Location = New System.Drawing.Point(498, 421)
Me.btnStartVideoCapture.Name = "btnStartVideoCapture"
Me.btnStartVideoCapture.Size = New System.Drawing.Size(89, 38)
Me.btnStartVideoCapture.TabIndex = 2
Me.btnStartVideoCapture.Text = "START"
Me.btnStartVideoCapture.UseVisualStyleBackColor = False
'
'FlowLayoutPanel1
'
Me.FlowLayoutPanel1.Location = New System.Drawing.Point(0, 421)
Me.FlowLayoutPanel1.Name = "FlowLayoutPanel1"
Me.FlowLayoutPanel1.Size = New System.Drawing.Size(502, 38)
Me.FlowLayoutPanel1.TabIndex = 3
'
'Panel1
'
Me.Panel1.Location = New System.Drawing.Point(0, -3)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(587, 418)
Me.Panel1.TabIndex = 4
'
'Form1
'
Me.BackColor = System.Drawing.Color.Black
Me.ClientSize = New System.Drawing.Size(585, 458)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.FlowLayoutPanel1)
Me.Controls.Add(Me.btnStartVideoCapture)
Me.Name = "Form1"
Me.ResumeLayout(False)
End Sub
Private WithEvents btnStartVideoCapture As System.Windows.Forms.Button
Friend WithEvents FlowLayoutPanel1 As System.Windows.Forms.FlowLayoutPanel
Friend WithEvents Panel1 As System.Windows.Forms.Panel
End Class
In the startStopCapturing you dont't check if the capture IsNothing. The capture object is initialized when you enter the preview method at the form Shown event or at the timer event.
Everywhere you have code in place that checks the capture object for IsNothing and to avoid using it but, in startStopCapturing, you don't have this check to protect the code in the IF that change the button text.
Private Sub startOrStopCapturing(capture As Capture)
btnStartVideoCapture.Visible = False
If capture IsNot Nothing Then
capture.[Stop]()
capture.Dispose()
capture = Nothing
If timer.Enabled Then
timer.[Stop]()
End If
btnStartVideoCapture.Text = "START"
btnStartVideoCapture.BackColor = Color.DarkSlateBlue
Else
Try
capture = New Capture(filters.VideoInputDevices(deviceNumber), _
filters.AudioInputDevices(0))
capture.Filename = counter & ".wmv"
capture.Cue()
capture.Start()
timer.Start()
btnStartVideoCapture.Text = "STOP"
btnStartVideoCapture.BackColor = Color.Maroon
Catch ex As Exception
MessageBox.Show("Error Message: " & vbLf & vbLf & ex.Message)
End Try
End If
btnStartVideoCapture.Visible = True
End Sub
Also this code in the inline button_click event seems to be wrong
If capture IsNot Nothing Then
capture.Dispose()
capture.[Stop]()
capture.PreviewWindow = Nothing
End iF
Do not use a disposed object and set it to Nothing because without that you could fool again your code in belivieng that the capture object is valid
If capture IsNot Nothing Then
capture.[Stop]()
capture.PreviewWindow = Nothing
capture.Dispose()
capture = Nothing
End iF

MsgBox not displayed on 1st click after changing content in textbox

I am trying to learn by creating this basic form. where the user is asked a password and username
currently both are text field and insecure.
the problem is that whenever i change any of the 2 fields the 1st click does not work.
the code works fine from 2nd click.
edit- there is no problem till the user and password are wrong.
here is the snippet
Private Sub BtnLogIn_Click(sender As Object, e As EventArgs) Handles BtnLogIn.Click
If (TxtUsername.Text = "shikhar" And TxtPassword.Text = "pass") Then
'goto next screen & remove message box'
MsgBox("correct Username or Password", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "login Completed")
Else
MsgBox("Incorrect Username or Password", MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, "login error")
End If
End Sub
this is the overall file-
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Login
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.lblUsername = New System.Windows.Forms.Label()
Me.lblPassword = New System.Windows.Forms.Label()
Me.TxtUsername = New System.Windows.Forms.TextBox()
Me.TxtPassword = New System.Windows.Forms.TextBox()
Me.BtnLogIn = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'lblUsername
'
Me.lblUsername.AutoSize = True
Me.lblUsername.Location = New System.Drawing.Point(69, 84)
Me.lblUsername.Name = "lblUsername"
Me.lblUsername.Size = New System.Drawing.Size(55, 13)
Me.lblUsername.TabIndex = 0
Me.lblUsername.Text = "Username"
'
'lblPassword
'
Me.lblPassword.AutoSize = True
Me.lblPassword.Location = New System.Drawing.Point(69, 130)
Me.lblPassword.Name = "lblPassword"
Me.lblPassword.Size = New System.Drawing.Size(53, 13)
Me.lblPassword.TabIndex = 1
Me.lblPassword.Text = "Password"
'
'TxtUsername
'
Me.TxtUsername.Location = New System.Drawing.Point(178, 77)
Me.TxtUsername.Name = "TxtUsername"
Me.TxtUsername.Size = New System.Drawing.Size(199, 20)
Me.TxtUsername.TabIndex = 2
'
'TxtPassword
'
Me.TxtPassword.Location = New System.Drawing.Point(178, 123)
Me.TxtPassword.Name = "TxtPassword"
Me.TxtPassword.Size = New System.Drawing.Size(198, 20)
Me.TxtPassword.TabIndex = 3
'
'BtnLogIn
'
Me.BtnLogIn.Location = New System.Drawing.Point(181, 172)
Me.BtnLogIn.Name = "BtnLogIn"
Me.BtnLogIn.Size = New System.Drawing.Size(164, 45)
Me.BtnLogIn.TabIndex = 4
Me.BtnLogIn.Text = "Log In"
Me.BtnLogIn.UseVisualStyleBackColor = True
'
'Login
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(474, 261)
Me.Controls.Add(Me.BtnLogIn)
Me.Controls.Add(Me.TxtPassword)
Me.Controls.Add(Me.TxtUsername)
Me.Controls.Add(Me.lblPassword)
Me.Controls.Add(Me.lblUsername)
Me.Name = "Login"
Me.Text = "Login"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents lblUsername As System.Windows.Forms.Label
Friend WithEvents lblPassword As System.Windows.Forms.Label
Friend WithEvents TxtUsername As System.Windows.Forms.TextBox
Friend WithEvents TxtPassword As System.Windows.Forms.TextBox
Friend WithEvents BtnLogIn As System.Windows.Forms.Button
End Class