codeorder 197 Nearly a Posting Virtuoso
MRMMain.Text = cmbBoxUsers.TEXT
codeorder 197 Nearly a Posting Virtuoso

Just thought I'd help.

codeorder 197 Nearly a Posting Virtuoso

As for adding a WebBrowser to the Form, check out this thread.

codeorder 197 Nearly a Posting Virtuoso

Not sure if you noticed, but you have the same code in: Private Sub TextBox5_TextChanged(... for team 2 as you do for team 1 in: Private Sub TextBox1_TextChanged(... . Both add up a total for team 1.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.
2 TextBoxes, 1 Label

Public Class Form1
    Private iTeam1Total As Integer = 0 '// Declaration.

    '// Use the _TextChanged Event. Can add all TextBoxes that are for the same team, as the commented TextBox3.TextChanged.
    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
                        Handles TextBox1.TextChanged, TextBox2.TextChanged ',TextBox3 .TextChanged '// etc.
        Try '//---- Catch errors to not crash the app. if not a Numeric value in TextBoxes.
            '// Add to your Team's Total.
            iTeam1Total = CInt(TextBox1.Text) + CInt(TextBox2.Text) '// CInt = Convert to Integer, since .Text is a String.
        Catch ex As Exception
        End Try '---\\
        Label1.Text = iTeam1Total '// Display Result.
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Text = "0" : TextBox2.Text = "0"
    End Sub
End Class

LostFocus is when a Control looses Focus.
For example, you click TextBox1, then click TextBox2. TextBox1 will loose Focus and if you have anything in the TextBox1_LostFocus Event, that event will fire with the code within.

Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
        MsgBox("TextBox1 Lost Focus", MsgBoxStyle.Information)
    End Sub

As for debating over TextBoxes, try the different controls on your own and see which would benefit your project the best.:)

codeorder 197 Nearly a Posting Virtuoso

If you just want to Delete a File from the system, use:

IO.File.Delete("full path of file to delete here")

Otherwise, let me know if this helps.
1 Button, 1 ProgressBar(useful when shredding the file over 10,000 times :D)

Public Class Form1
    Private iNumberOfTimesToShred As Integer = 10 '// Times to load/manipulate/save the File.
    Private iNumberOfCharactersToInjectPerShred As Integer = 25 '// Characters in sCharactersToInjectIntoFile. 
    '// Loaded a image in Notepad++ and found tons of cool char. to inject into the File Randomly.
    Private sCharactersToInjectIntoFile As String = "›ÙÅ×¾e…€è½Ø`WØÙÛlÕÎÓ¶mßSöÌ‹ïº;ϼç;¶mßSöÌ‹ïº;ϼç;éHO>òßp¦B‚ƺŒßf=¦ì°¡óÓlÜòL›™tØ–l;a«wŸù1òag½1â;éHO>Ó|¤Õì0ÙšöÓqÖ#W[W­’î;uKŽ1š•Ý3Z±5²èqÃnͦíÓ0íè%;xê%;õ¯õëï}lKVm´µ[Ò,mÿIË:ù¬í>¬UÕ©:½ã¾¬Ž—fw}ýnÓe,&¹xDEb{XÑê=­tmš)ý®ƒúå=¤!î(Ê–}òeè×}Ý‘7¬v÷ÉöPöíïÿ«ýâ÷±¿üãú÷7ŸµÖî/RËÊk¨SI‹"
    Private sMain As String = Nothing '// String to load File in and manipulate the file content.
    Private sTemp, sTemp2 As String '// Temp Strings used as needed.
    Private rnd As New Random '// Used to Randomize which characters to replace and which characters to inject.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ofd As New OpenFileDialog
        If ofd.ShowDialog = DialogResult.OK Then
            sMain = IO.File.ReadAllText(ofd.FileName, System.Text.Encoding.Default) '// Load File as String.
            ProgressBar1.Maximum = iNumberOfTimesToShred : ProgressBar1.Value = 0 '// Set/Reset Properties of Progressbar.
            Do Until ProgressBar1.Value = iNumberOfTimesToShred '// Loop until the ProgressBar.Value is the Total of times to Shred.
                For i As Integer = 1 To iNumberOfCharactersToInjectPerShred '// inject random char. in file.
                    sTemp = sCharactersToInjectIntoFile.Substring(rnd.Next(0, sCharactersToInjectIntoFile.Length), 1) '// get random char.
                    rnd = New Random : sMain = sMain.Insert(rnd.Next(0, sMain.Length), sTemp) '// insert at random into File.
                Next
                sTemp = sMain.Substring(rnd.Next(0, sMain.Length), 1) '// select a random char.
                rnd = New Random : …
mrbungle commented: Great insight! +1
codeorder 197 Nearly a Posting Virtuoso

For drag and drop, check out this thread.

About "wiping" a file from the disk, do you want to just delete the file or shred the file a few times, then delete?

codeorder 197 Nearly a Posting Virtuoso

Do you happen to have a link to the website you are trying to programatically register to?
..The link and overlooking the HTML Source code of the site should help out quite a bit with your issue.

codeorder 197 Nearly a Posting Virtuoso

Check out this link. Read through it for more info and follow the link provided in the that thread to load an application in a Form, not a TabControl.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private myOFD As New OpenFileDialog
    Private selectedTextBox As New TextBox '// Declare new TextBox.

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

    Private Sub addTextBoxHandlers()
        Dim txt As TextBox
        For i As Integer = 1 To 36
            txt = DirectCast(Me.Controls.Item(Me.Controls.IndexOfKey("TextBox" & i.ToString)), TextBox)
            AddHandler txt.Click, AddressOf txt_Click
            AddHandler txt.GotFocus, AddressOf txt_GotFocus '// Assign each TextBox to the txt_GotFocus Event.
        Next
    End Sub

    Private Sub txt_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        If myOFD.ShowDialog = DialogResult.OK Then
            CType(sender, TextBox).Text = myOFD.FileName
        End If
    End Sub

    Private Sub txt_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) ' Handles TextBox1.GotFocus
        Me.selectedTextBox = CType(sender, TextBox) '// Set sender as the selected TextBox.
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Text = Me.selectedTextBox.Text '// display text of selected TextBox.
    End Sub
End Class

------------------
As for the AddressOf...
When you do this:

Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click, TextBox2.Click, TextBox3.Click, TextBox4.Click, TextBox5.Click, TextBox6.Click, TextBox7.Click, TextBox8.Click, TextBox9.Click, TextBox10.Click, TextBox11.Click, TextBox12.Click, TextBox13.Click, TextBox14.Click, TextBox15.Click, TextBox16.Click, TextBox17.Click, TextBox18.Click, TextBox19.Click, TextBox20.Click, TextBox21.Click, TextBox22.Click, TextBox23.Click, TextBox24.Click, TextBox25.Click, TextBox26.Click, TextBox27.Click, TextBox28.Click, TextBox29.Click, TextBox30.Click, TextBox31.Click, TextBox32.Click, TextBox33.Click, TextBox34.Click, TextBox35.Click, TextBox36.Click

..You are giving each TextBox the AddressOf the .Click Event.

Basically, I took this part:

Private Sub TextBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Renamed it from: TextBox1_Click to: txt_Click and dynamically assigned that Event for each …

codeorder 197 Nearly a Posting Virtuoso

With this code sample, you can add all of your TextBoxes to the txt_Click Event in one shot.

Public Class Form1

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

    Private Sub addTextBoxClickHandlers()
        Dim txt As TextBox
        For i As Integer = 1 To 36
            txt = DirectCast(Me.Controls.Item(Me.Controls.IndexOfKey("TextBox" & i.ToString)), TextBox)
            AddHandler txt.Click, AddressOf txt_Click '// Assign each TextBox to the txt_Click Event.
        Next
    End Sub

    Private Sub txt_Click(ByVal sender As Object, ByVal e As System.EventArgs) 'Handles TextBox1.Click
        MsgBox(CType(sender, TextBox).Name)
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private myOFD As New OpenFileDialog

    Private Sub txt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Click, TextBox2.Click, TextBox3.Click
        If myOFD.ShowDialog = DialogResult.OK Then
            CType(sender, TextBox).Text = myOFD.FileName
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Will I get cookies and milk if I do so?:D
-------
To start of, you will need to specify your Web File's Location that you want to download, here:

Private myURL As String = "http://www.dotpdn.com/files/Paint.NET.3.5.6.Install.zip"

..For example, to download the DaniWeb.com logo, use:

Private myURL As String = "http://www.daniweb.com/rxrimages/logo.gif"

Next, you will need to specify a location for the file on your computer.
This line saves the File to a user's Desktop with the original File Name by getting all the text following the ".LastIndexOf("/")", which usually is only the FileName, although in some cases it will not be.

Private myFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & myURL.Substring(myURL.LastIndexOf("/"))

..You can specify a Location on your computer and give it a file name of it's own. A simple SaveFileDialog could be of use for such.

Private myFile As String = "C:\myCoolDaniWebLogo.gif"

The rest of the code should be self explanatory.

I added "WithEvents" to the declaration for the WebClient, to display the WebClient's Events.
Can be located in the right ComboBox in the top of the code window once the WebClient is selected in the left ComboBox.

Private WithEvents myWebClient As New Net.WebClient()

Button1 declares the WebClient as a New WebClient.
Sets the ProgressBar Value to 0.
Me.Text...
Starts the Download. myWebClient.DownloadFileAsync("Web File Location", "Your Location for the File on your computer") Button1...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As …
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
2 Buttons (Button1, Button2), 1 ProgressBar

Public Class Form1
    '// Url for Paint.NET Download. ( http://www.getpaint.net/ )
    Private myURL As String = "http://www.dotpdn.com/files/Paint.NET.3.5.6.Install.zip"
    '// File Location Saved to Desktop with the Original File Name and Extension.
    Private myFile As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & myURL.Substring(myURL.LastIndexOf("/"))
    '// WebClient for Downloading File.
    Private WithEvents myWebClient As New Net.WebClient()

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Button1.Text = "Download" : Button2.Text = "Cancel"
    End Sub

    '// Download.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        myWebClient = New Net.WebClient
        ProgressBar1.Value = 0
        Me.Text = "Downloading..."
        myWebClient.DownloadFileAsync(New Uri(myURL), myFile)
        Button1.Enabled = False
    End Sub
    '// Cancel Download.
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        myWebClient.CancelAsync()
        Application.DoEvents()
        Button1.Enabled = True
        Me.Text = "Download Canceled"
    End Sub

    Private Sub myWebClient_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles myWebClient.DownloadFileCompleted
        If ProgressBar1.Value = ProgressBar1.Maximum Then
            MsgBox("Download Completed", MsgBoxStyle.Information)
            Button1.Enabled = True
        Else
            IO.File.Delete(myFile) '// Delete File if Download is NOT Complete.
        End If
    End Sub
    '// Download Progress.
    Public Sub myWebClient_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles myWebClient.DownloadProgressChanged
        Try
            Dim dDownloadProgress As Decimal = CStr(e.BytesReceived / e.TotalBytesToReceive * 100)
            ProgressBar1.Value = CInt(dDownloadProgress)
            '// Display Download Status.
            Dim dDownloadedMB As Decimal = Format((e.BytesReceived / 1024) / 1024, "###,###,##0.00")
            Dim dTotalToDownloadMB As Decimal = Format((e.TotalBytesToReceive / 1024) / 1024, "###,###,##0.00")
            Me.Text = "Downloaded: " & dDownloadedMB & "MB out of " & dTotalToDownloadMB & "MB …
Unhnd_Exception commented: Very Nice +1
mrbungle commented: Good job bro! Well done! +1
codeorder 197 Nearly a Posting Virtuoso
myWriter.WriteLine("alert tcp any any -> any any (content:" & myItem.Substring(0, myItem.IndexOf("/")) & "; uricontent:" & myItem.Substring(myItem.IndexOf("/")) & "; nocase" & "; sid:" & iSid & "; rev:1;")

And to load, you would use:

MsgBox(arTemp(0) & vbNewLine & arTemp(1) & vbNewLine & arTemp(2) & vbNewLine & arTemp(3) & vbNewLine & arTemp(4)) '// Display result.
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    '// Prices for the CheckBoxes as Decimal Arrays.
    Private myCoolCheckBoxPrices() As Decimal = {2, 3.5, 4.35, 1.75, 5, 9.99, 0.75}
    '// To get the value of the 3rd Array, since Index based, you would use: myCoolCheckBoxPrices(2)

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myTotalPrice As Decimal = 0 '// Reset Total Price.
        '// If CheckBox is Checked, add the Decimal Array to myTotalPrice.
        If CheckBox1.Checked Then myTotalPrice += myCoolCheckBoxPrices(0)
        If CheckBox2.Checked Then myTotalPrice += myCoolCheckBoxPrices(1)
        If CheckBox3.Checked Then myTotalPrice += myCoolCheckBoxPrices(2)
        If CheckBox4.Checked Then myTotalPrice += myCoolCheckBoxPrices(3)
        If CheckBox5.Checked Then myTotalPrice += myCoolCheckBoxPrices(4)
        If CheckBox6.Checked Then myTotalPrice += myCoolCheckBoxPrices(5)
        If CheckBox7.Checked Then myTotalPrice += myCoolCheckBoxPrices(6)
        MsgBox(myTotalPrice.ToString("c")) '// Display result.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

If your Public declaration is on Form1, then call it like: [B]Form1.MyPath[/B] from any other Form.

Also, always set a Declaration Type when declaring something. In this case, "String" = Type.

Public MyPath As String = "C:\"
codeorder 197 Nearly a Posting Virtuoso

It should only loop the first time, until it creates the file.
If needed, remove the:

Else '// For Testing Purposes: Restarts to Save the File if it does not exist.
            Application.Restart()

Or rename your file to a Directory available on your p.c..

Private myCoolFile As String = "C:\test.txt" '// your File. Make sure there is NO Previous "C:\test.txt" File.
codeorder 197 Nearly a Posting Virtuoso

See if this thread helps.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private myCoolFile As String = "C:\test.txt" '// your File. Make sure there is NO Previous "C:\test.txt" File.
    Private arlUrlList As New ArrayList '// ArrayList to add your Urls.

    Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        '// Add some Urls to the ArrayList for testing.
        arlUrlList.Add("daniweb.com/forums/thread344440.html")
        arlUrlList.Add("daniweb.com/forums/forum58.html")
        arlUrlList.Add("google.com/firefox?client=firefox-a&rls=org.mozilla:en-US:official")

        Dim iSid As Integer = 17000001 '// your sid #.
        Dim myWriter As New IO.StreamWriter(myCoolFile) '// Open a StreamWriter to Save Urls to File.
        For Each myItem As String In arlUrlList '// Loop thru all items in Urls List.
            '// write to File( .Substring from 0 to the First Index of "/" ; .Substring from the First Index of "/" to end of String ; and your sid # )
            myWriter.WriteLine(myItem.Substring(0, myItem.IndexOf("/")) & ";" & myItem.Substring(myItem.IndexOf("/")) & ";sid:" & iSid)
            iSid += 1 '// Increment the sid # + 1.
        Next
        myWriter.Close()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If IO.File.Exists(myCoolFile) Then
            Dim arMyFileLines() As String = IO.File.ReadAllLines(myCoolFile) '// Load each line as a String Array.
            Dim arTemp() As String '// .Split each Line.
            For Each myLine As String In arMyFileLines '// Lopp thru all Lines.
                arTemp = myLine.Split(";"c) '// .Split Line by the ";" char.
                MsgBox(arTemp(0) & vbNewLine & arTemp(1) & vbNewLine & arTemp(2)) '// Display result.
            Next
        Else '// For Testing Purposes: Restarts to Save the File if it does not exist.
            Application.Restart()
        End If
    End Sub
End Class
dipopo commented: Codeorder is a fantastic helper. I am highly appreciative of his work! +0
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://google.com")
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        AddHandler WebBrowser1.Document.Click, AddressOf getClickedElement '// Add .Click Event.
    End Sub

    Private Sub getClickedElement(ByVal sender As Object, ByVal e As HtmlElementEventArgs)
        With WebBrowser1.Document.GetElementFromPoint(e.ClientMousePosition)
            Dim selectedHtmlElement_ID As String = .GetAttribute("id").ToLower
            Dim selectedHtmlElement_NAME As String = .GetAttribute("name").ToLower
            '// Results for ID and Name.
            Me.Text = "ID: " & selectedHtmlElement_ID & vbNewLine & " --- Name: " & selectedHtmlElement_NAME
        End With
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
2 TextBoxes (txtUserName and txtPassword), 1 Button(Button1)

Public Class Form1

    Private myCoolUserName As String = "codeorder"
    Private myCoolPassword As String = ".net"

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not txtUserName.Text = myCoolUserName Then '// check if User Name is NOT Correct.
            MsgBox("Incorrect User Name.", MsgBoxStyle.Critical) '// Notify User.
            txtUserName.Text = "" : txtPassword.Text = "" '// Clear both TextBoxes.
            txtUserName.Select()
            Exit Sub '// skip remaining code.
        ElseIf txtUserName.Text = myCoolUserName AndAlso Not txtPassword.Text = myCoolPassword Then '// if User Name is Correct and Password is NOT.
            MsgBox("Incorrect Password.", MsgBoxStyle.Critical) '// Notify User.
            txtPassword.Text = "" '// Clear only the Password TextBox.
            txtPassword.Select()
            Exit Sub '// skip remaining code.
        Else
            MsgBox("Login Successful.", MsgBoxStyle.Information) '// Run Login code here.
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Since vbScript is quite similar to vb.net, I decide to give it a try.
My Notepad++ is nothing like the vb.net code editor :D, but it does quite nicely.

See if this helps as my first attempt at VbScript.

Select Case LCase(Answer)'// to Lower Case, not to be Case Sensitive.
	Case "rock"
		If CardImage = "Paper" Then MsgBox "Paper Covers Rock: Computer Wins!"
		If CardImage = "Scissors" Then MsgBox "Rock Breaks Scissors: You Win!"
		If CardImage = "Rock" Then MsgBox "TIE!" 
	Case "paper" 
		If CardImage = "Scissors" Then MsgBox "Scissors Cuts Paper: Computer Wins!"
		If CardImage = "Rock" Then MsgBox "Paper Covers Rock: You Win!"
		If CardImage = "Paper" Then MsgBox "TIE!"
	Case "scissors"
		If CardImage = "Rock" Then MsgBox "Rock Breaks Scissors: Computer Wins!"
		If CardImage = "Paper" Then MsgBox "Scissors Cuts Paper: You Win!"
		If CardImage = "Scissor" Then MsgBox "TIE!" 
End Select

Btw, interesting topic.

AndreRet commented: Not bad for a .netter :) +6
codeorder 197 Nearly a Posting Virtuoso

Double click your TextBox1 and you will get the "TextBox1_TextChanged" Event.
This Event can also be located at the very top of the code window in the right ComboBox once your TextBox1 is selected in the left ComboBox. View attached image.

Try this in a New Project with 1 TextBox and 1 Button.

Public Class Form1

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Me.BackColor = Color.Orange
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.BackColor = Color.Empty
        TextBox1.Select()
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private allowCoolMove As Boolean = False
    Private myCoolPoint As New Point

    Private Sub Panel1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseDown
        allowCoolMove = True
        myCoolPoint = New Point(e.X, e.Y)
        Me.Cursor = Cursors.SizeAll
    End Sub

    Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
        If allowCoolMove = True Then
            Panel1.Location = New Point(Panel1.Location.X + e.X - myCoolPoint.X, Panel1.Location.Y + e.Y - myCoolPoint.Y)
        End If
    End Sub

    Private Sub Panel1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseUp
        allowCoolMove = False
        Me.Cursor = Cursors.Default
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Also, check out this link for a more defined explanation to using "Command Line Arguments".

codeorder 197 Nearly a Posting Virtuoso

Why not subtract the Value of your ListView2.SubItem just before you remove your ListView2.Item?

codeorder 197 Nearly a Posting Virtuoso

Check out this link.

codeorder 197 Nearly a Posting Virtuoso

I'm not sure exactly to "why" this occurs, but you can try the solution by sandeepparekh9 and use:

Sub New()
        Category.retrieveRec(New Button) 
    End Sub

..and remove the Optional, as it was originally posted.

codeorder 197 Nearly a Posting Virtuoso

Check out your other thread.
http://www.daniweb.com/forums/post1457647.html#post1457647

Please do not double post. Refresh the thread if needed by replying to it. Thanks.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If ComboBox1.Text = Nothing OrElse ComboBox2.Text = Nothing Then Exit Sub
        Label1.Text = CInt(ComboBox1.Text) + CInt(ComboBox2.Text) '// CInt = Convert to Integer, since .Text is considered a String.
    End Sub
codeorder 197 Nearly a Posting Virtuoso

In that case I would use the "Optional", where you have the "Option" to send a Button or Not.

Public Sub retrieveRec(Optional ByVal myCoolSelectedButton As Button = Nothing)
codeorder 197 Nearly a Posting Virtuoso

Another approach.

Public Class Form1
    Private myCoolClass As New testClass

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        myCoolClass.retrieveRec(Button1)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        myCoolClass.retrieveRec(Button2)
    End Sub
End Class
Public Class testClass
    Public Sub retrieveRec(ByVal myCoolSelectedButton As Button)
        Select Case myCoolSelectedButton.Name
            Case "Button1"
                MsgBox("Button1 is the Sender.")
            Case "Button2"
                MsgBox("Button2 is the Sender.")
        End Select
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Also, check out this link.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each ctl As Control In Me.Controls '// Loop thru all controls.
            If TypeOf ctl Is TextBox Then '// Locate TextBoxes.
                AddHandler ctl.KeyPress, AddressOf txt_KeyPress '// Associate the KeyPress Event with the TextBox.
            End If
        Next
    End Sub
    '// Renamed from: Private Sub TextBox1_KeyPress
    Private Sub txt_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) ' Handles TextBox1.KeyPress
        If e.KeyChar <> ChrW(Keys.Back) Then
            If Char.IsNumber(e.KeyChar) Then

            Else
                MessageBox.Show("Invalid Input! Numbers Only.", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error)
                e.Handled = True
            End If
        End If
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

If TextBox1.Text = Nothing OrElse TextBox2.Text = Nothing OrElse TextBox3.Text = Nothing Then
            MsgBox("TextBoxes CANNOT be Empty.", MsgBoxStyle.Critical)
            Exit Sub '// Skip the remaning code in the Sub.
        End If
        '// Save code here.
rEhSi_123 commented: Exactly what I was looking for! Excellent +3
codeorder 197 Nearly a Posting Virtuoso

See if this helps about drawing a border around a Label.

Dim myCoolPenstyle As New Pen(Color.Red, 2) '// (color, pen width.)
        With Label1 '// draw just outside the Bounds of the Label.
            Me.CreateGraphics.DrawRectangle(myCoolPenstyle, .Location.X - 1, .Location.Y - 1, .Width + 2, .Height + 2)
        End With
codeorder 197 Nearly a Posting Virtuoso

:D
I'm sure such happens even to the best of us. It's part of being "human".

codeorder 197 Nearly a Posting Virtuoso

Replace the "MsgBox(selFile) '// Show FullPath of File.)" with this.

Export = Path.GetFileName(selFile) 'sends only the filename and extension to the variable export
        FileCopy(selFile, "c:\flexihotfolder\" & Export)
ayarton commented: AWESOME! +1
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

OpenFD.Multiselect = True '// Allow Multiple File Selections.
        If OpenFD.ShowDialog = DialogResult.OK Then
            For Each selFile As String In OpenFD.FileNames
                MsgBox(selFile) '// Show FullPath of File.
            Next
        End If
codeorder 197 Nearly a Posting Virtuoso

See if this helps for the TrackBar.
1 MenuStrip(MenuStrip1)

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim myTrackBar As New TrackBar '// Declare New TrackBar.
        myTrackBar.Minimum = 12 : myTrackBar.Maximum = 25 '// Customize.
        AddHandler myTrackBar.Scroll, AddressOf TrackBar_Scroll '// Give it a Event to Handle.
        Dim myCtlHost As New ToolStripControlHost(myTrackBar)
        MenuStrip1.Items.Add(myCtlHost) '// Add to Main Menu.
        '// OR...
        'FileToolStripMenuItem.DropDownItems.Add(myCtlHost) '// Add to DropDownItems.
    End Sub

    Private Sub TrackBar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) ' Handles TrackBar1.Scroll
        Dim trk As TrackBar = CType(sender, TrackBar)
        Me.Text = trk.Value.ToString '// For testing.
    End Sub
End Class

If "numeric dropdown" is a ComboBox, right click Menu and view attached image.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim fontName As FontFamily = TextBox1.Font.FontFamily '// Get the Current Font Name used.
        TextBox1.Font = New Font(fontName, TrackBar1.Value) '// Set Font Name and Size.
codeorder 197 Nearly a Posting Virtuoso
For x As Integer = 1 To CInt(UserInputTextbox.Text)
            For Each ctl As Control In Me.Controls '// Loop thru all Controls on Form.
                If TypeOf (ctl) Is Panel Then '// Locate Panels.
                    If ctl.Name = "P" & x.ToString Then
                        ctl.Enabled = True
                        Exit For
                    End If
                End If
            Next
        Next
codeorder 197 Nearly a Posting Virtuoso

vanzhyme, private message sent.
Please start your own thread from now on, for your "own" questions/replies.

codeorder 197 Nearly a Posting Virtuoso

If you do not need to send just the text from Form1's TextBox1 to Form2's TextBox1, but need to copy the entire TextBox control from Form1 and add it Form2, see if this helps.

Dim txt As TextBox = TextBox1
        'txt.Location = New Point(0, 0) '// If Location needs to be changed.
        Form2.Controls.Add(txt)
        Form2.Show()
codeorder 197 Nearly a Posting Virtuoso
Dim myCoolOpenFileDialog As New OpenFileDialog
        If myCoolOpenFileDialog.ShowDialog = DialogResult.OK Then
            '// Load File from Full Path.
            MsgBox(myCoolOpenFileDialog.FileName)
        End If
codeorder 197 Nearly a Posting Virtuoso
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Form2.TextBox1.Text = TextBox1.Text
        Form2.Show()
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Not quite understanding your question.
..If you need to have a TextBox get reversed as the File does, try this quick fix.

Change this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myFile As String = "C:\test.txt" '// your File.
        If IO.File.Exists(myFile) Then '// Check if File.Exists.
            MsgBox(reverseFileContent(myFile)) '// Display Result.
            IO.File.WriteAllText(myFile, reverseFileContent(myFile)) '// Save Reversed File.
        Else : MsgBox("File Does Not Exist.")
        End If
    End Sub

    Function reverseFileContent(ByVal mySelectedFile As String) As String
        Dim arFileLines() As String = IO.File.ReadAllLines(mySelectedFile) '// Load each line as a String Array.
        Dim arWords() As String = Nothing '// used to Split. each line into Words.
        Dim sChar As String = Nothing '// used to get/set last char of word if not a Letter.

To:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = reverseFileContent(TextBox1.Lines)
    End Sub

    Function reverseFileContent(ByVal arFileLines() As String) As String
        '// Load each TextBox Line as a String Array.
        Dim arWords() As String = Nothing '// used to Split. each line into Words.
        Dim sChar As String = Nothing '// used to get/set last char of word if not a Letter.
codeorder 197 Nearly a Posting Virtuoso

yeH syug!

woH nac I trevni ro( esrever, revetahw) a gnirts, tub gnisrever hcae drow?

ekiL:

sihT si a gnirts.
tuptuO:

This is a string.
dna ton:

string. a is This
oslA, woh nac I od ti ot a eritne elif?

sknahT ni ecnavda!

teL em wonk fi siht spleh.:D

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim myFile As String = "C:\test.txt" '// your File.
        If IO.File.Exists(myFile) Then '// Check if File.Exists.
            MsgBox(reverseFileContent(myFile)) '// Display Result.
            IO.File.WriteAllText(myFile, reverseFileContent(myFile)) '// Save Reversed File.
        Else : MsgBox("File Does Not Exist.")
        End If
    End Sub

    Function reverseFileContent(ByVal mySelectedFile As String) As String
        Dim arFileLines() As String = IO.File.ReadAllLines(mySelectedFile) '// Load each line as a String Array.
        Dim arWords() As String = Nothing '// used to Split. each line into Words.
        Dim sChar As String = Nothing '// used to get/set last char of word if not a Letter.
        Dim sTemp As String = Nothing '// used to save Reversed Lines.
        For iFileLineNumber As Integer = 0 To arFileLines.Length - 1 '// Loop thru all Lines.
            If arFileLines(iFileLineNumber).Contains(" "c) Then '// Check if Current Line Contains. a "space".
                arWords = arFileLines(iFileLineNumber).Split(" "c) '// Split. Line into Words by "space".
                For iWord As Integer = 0 To arWords.Length - 1  '// Loop thru all Words.
                    If Not arWords(iWord) = Nothing Then '// check if Word is not Nothing, since Words get Split. by " ".
                        If Char.IsLetter(CChar(arWords(iWord).Substring(arWords(iWord).Length - 1, 1))) Then '// …
Rian_3 commented: can you make textbox1 output to textbox2 +0
codeorder 197 Nearly a Posting Virtuoso

Check out this link about formatting to currency.

Overlooking your code, I would set both, the EmplyeeType and RegularPay in the same hit.

If RadioButton1.Checked = True Then
            strEmployeeType = strTrainee : intRegularPay = 10
        ElseIf RadioButton2.Checked = True Then
            strEmployeeType = strRegular : intRegularPay = 15
        ElseIf RadioButton3.Checked = True Then
            strEmployeeType = strManager : intRegularPay = 20
        End If