codeorder 197 Nearly a Posting Virtuoso

>>However I can not figure out how to Save using active child just calling the actual form name.

In any case, if just one control on the MdiForm, see if this helps.

If Not Me.ActiveMdiChild Is Nothing Then
            MsgBox(Me.ActiveMdiChild.Controls(0).Text)
        End If
tim.newport commented: Lead me in right direction , thanks +1
codeorder 197 Nearly a Posting Virtuoso

If you were getting the Conversion from type 'Match' to type 'String' is not valid. , you just needed to get the .Value of the Match .

For Each itemcode As Match In matches
            ListBox1.Items.Add(itemcode.Value)
        Next
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

With frmCitation.txtPlate
            If Not .Text = "" Then '// check if TextBox has text.
                writer.WriteStartElement("VEHICLE_LICENSE_NUMBER") '10-28
                writer.WriteString(.Text.ToString)
                writer.WriteEndElement()
            End If
        End With
Unhnd_Exception commented: Thanks codeorder +1
codeorder 197 Nearly a Posting Virtuoso
For Each item As ListViewItem In ListView1.Items
            If item.Checked = False Then '// check if Not Checked.
                MsgBox(item.SubItems(1).Text) '// get value of "item" .SubItems(1).
            End If
        Next
bLuEmEzzy commented: thank u :) +1
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
        If Not Me.ActiveMdiChild Is Nothing Then '// check if Form available.
            MsgBox(Me.ActiveMdiChild.Name) '// get .Name of Active Form.
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub DataGridView1_RowsAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles DataGridView1.RowsAdded
        If DataGridView1.RowCount = 10 Then Button1.Enabled = False
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 Timer, 1 TextBox

Public Class Form1
   
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        With TextBox1
            '// check if Clipboad has Text and if Not TextBox has the Clipboard Text already.
            If Clipboard.ContainsText AndAlso Not .Text = Clipboard.GetText Then
                .Clear() : .Paste() '// clear for new data and paste to TextBox.
            End If
        End With
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

>> I would like to categorize the items in the list. I would like to make it to where anyone can change the categories in the list without having to have access to the source code.

What about adding a ContextMenu to the item with a "Edit Item" option that loads a Form and allows you to edit the item.Text, .Tag, .etc.?

codeorder 197 Nearly a Posting Virtuoso

Can you post the entire For/Next loop code and specify which line is giving you the finger, I mean "error".:D

codeorder 197 Nearly a Posting Virtuoso

>>Is there a way to put comments in the .ini's that the reader will ignore?
I believe that comment lines for a .ini file start with ";".

[category title 1]
;Documentation=kewl
Application Name=VS Professional
Application Path to EXE=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Description=Software developing product

[category title 2]
;Documentation=kewl also
Application Name=Firefox
Application Path to EXE=C:\Program Files (x86)\Mozilla Firefox\firefox.exe
Description=Web browser of choice

I would load the file in a String Array and loop thru lines.

See if this helps for adding items with .Click Event and ToolTipText to a ToolStripDropDownButton.
1 ToolStripDropDownButton

Public Class Form1
    Private myIniFile As String = "C:\test.ini" '// your File.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If IO.File.Exists(myIniFile) Then
            Dim arTemp() As String = IO.File.ReadAllLines(myIniFile) '// load lines as arrays.
            For i As Integer = 0 To arTemp.Length - 1 '// loop thru lines.
                '// check for lines like: [category title 1]
                If arTemp(i).StartsWith("[") Then '// once located, you know the next 4 lines are for that category.
                    '// line 2 in category.
                    Dim mItem As New ToolStripMenuItem(arTemp(i + 2).Substring(arTemp(i + 2).IndexOf("=") + 1)) '// add .Text of item.
                    '// line 3 in category.
                    mItem.Tag = arTemp(i + 3).Substring(arTemp(i + 3).IndexOf("=") + 1) '// add FullPath to .Tag.
                    '// line 4 in category.
                    mItem.ToolTipText = arTemp(i + 4).Substring(arTemp(i + 4).IndexOf("=") + 1) '// add Description as ToolTipText.
                    AddHandler mItem.Click, AddressOf myCoolDropDownItems_Click '// give the DropDownItem an Event to handle.
                    ToolStripDropDownButton1.DropDownItems.Add(mItem) '// add item to …
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 ComboBox (with items as stated in your post)

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ComboBox1
            '//-- set for AutoComplete.
            .AutoCompleteSource = AutoCompleteSource.CustomSource
            .AutoCompleteMode = AutoCompleteMode.SuggestAppend '--\\
            AddHandler .Validating, AddressOf cmb_Validating '// add ComboBox to Validating Event.
        End With
        '// use this to load/reload the AutoCompleteList with the ComboBox items.
        loadMyCoolAutoCompleteList(ComboBox1)
    End Sub

    Private Sub loadMyCoolAutoCompleteList(ByVal selectedComboBox As ComboBox)
        With selectedComboBox
            .AutoCompleteCustomSource.Clear() '// Clear AutoCompleteList.
            For Each itm As String In selectedComboBox.Items '// loop thru all items in the ComboBox.
                .AutoCompleteCustomSource.Add(itm) '// add original item to your AutoCompleteList.
                '// locate the .Substring you want to add to the AutoCompleteList.
                itm = itm.Substring(itm.IndexOf(":") + 2) '// get all text following the ":" and the " " right after it.
                .AutoCompleteCustomSource.Add(itm) '// add .Substring of item to your AutoCompleteList.
            Next
        End With
    End Sub

    '// once the ComboBox Validates (looses focus), it will set the original item as .Text.
    Private Sub cmb_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
        Dim selectedComboBox As ComboBox = CType(sender, ComboBox)
        For Each itm As String In selectedComboBox.Items '// loop thru all items in the ComboBox.
            If itm.Substring(itm.IndexOf(":") + 2) = selectedComboBox.Text Then '// locate the .Substring that matches the .Text.
                selectedComboBox.Text = itm '// set .Text of ComboBox item.
                Exit For '// exit loop since done locating item.
            End If
        Next
    End Sub
End Class
mrbungle commented: Again, mega kudos man!!! +1
codeorder 197 Nearly a Posting Virtuoso

See if this helps to add DropDownItems or Items to a menu.
1 MenuStrip(with a "File" menu item)

Public Class Form1
    Private myCoolFolder As String = "C:\"

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each myFile In My.Computer.FileSystem.GetFiles(myCoolFolder, FileIO.SearchOption.SearchTopLevelOnly, "*.*") '// get files.
            FileToolStripMenuItem.DropDownItems.Add(myFile) '// add as DropDownItems.
            ' MenuStrip1.Items.Add(myFile)'// add as Category on Menu.
        Next
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Over 800 lines of code to do what? Make it look like you've been busy programming to get no results? :D

You should try and give it a shot with the code I have previously posted.
.It's fairly easy to use.

myAddressBookEntries.Add(TextBox1.Text & "~" & TextBox2.Text & "~" & TextBox3.Text & "~" & TextBox4.Text)

That should add info as one item in the ArrayList.

To add items to the myAddressBookEntries ArrayList, use the code provided in my post to add items to it.

To save, use a For/Next loop.
All you have to do is:

Dim sTemp As String = "" '// add each item from ArrayList as a line.
        For Each myCoolEntry As String In myAddressBookEntries '// loop thru all items.
            If Not sTemp = "" Then sTemp &= vbNewLine & myCoolEntry Else sTemp = myCoolEntry '// add items to string.
        Next
        IO.File.WriteAllText("C:\test.txt", sTemp) '// save File.

When loading the file, read all lines and add the file lines to the ArrayList.

To get the values of each item, use the code provided in my post that .Splits the ArrayList items.

For btnPrevious/btnNext, use something like:

Private myIndexLocation As Integer = 0 '// keep track of location in the ArrayList.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox(myAddressBookEntries.Item(myIndexLocation))
        myIndexLocation += 1 '// set for next entry to view.
    End Sub

If you want to use a ListBox to display all the contacts name, load …

codeorder 197 Nearly a Posting Virtuoso

See if this helps to download all web files from a ListBox.

Dim myFolder As String = "C:\" '// folder to save files to.
        Dim sFileExtension As String = Nothing '// string to get the file extension from web file.
        Dim iFileNameNumber As Integer = 0 '// used to save file names as #'s.
        For Each itm As String In ListBox1.Items '// loop thru all items.
            sFileExtension = itm.Substring(itm.LastIndexOf("."c)) '// get file .Extension from web file path of ListBox item.
            iFileNameNumber += 1 '// increment for FileName.
            My.Computer.Network.DownloadFile(itm, myFolder & iFileNameNumber & sFileExtension) '// Download file.
        Next
        MsgBox("Files Download Successful.")
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private iImageNumber As Integer = 0 '// for images Index in ImageLists.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// set .SizeMode once.
        PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
        PictureBox2.SizeMode = PictureBoxSizeMode.StretchImage
        setImages() '// set images to PictureBoxes if needed.
        '// for testing.
        Button1.Text = "Previous" : Button2.Text = "Next"
    End Sub

    '// btnPrevious.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '// check if Not first image Then subtract -1, Else set # for last Image if wanting to loop thru images.
        If Not iImageNumber = 0 Then iImageNumber -= 1 Else iImageNumber = ImageList1.Images.Count - 1
        '// used ImageList1.Images.Count since both PictureBoxes seem to work with the same amount of images and no need to check both ImageLists.
        setImages()
    End Sub

    '// btnNext.
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        '// check if Not last image Then add +1, Else set # for first Image if wanting to loop thru images.
        If Not iImageNumber = ImageList1.Images.Count - 1 Then iImageNumber += 1 Else iImageNumber = 0
        setImages()
    End Sub

    Private Sub setImages()
        PictureBox1.Image = ImageList1.Images(iImageNumber)
        PictureBox2.Image = ImageList2.Images(iImageNumber)
    End Sub
End Class
debasisdas commented: I love the way you have coded. +8
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
1 Panel, 1 Button, 1 Timer

Public Class Form1
    Private eX, eY As Integer '// get Cursor location.
    Private rCursorBounds As New Rectangle(0, 0, 0, 0) '// rectangle used for Collision check.
    Private BlockY As Integer = 0 '// declared once.

    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        eX = e.X : eY = e.Y '// set coordinates for location of cursor.
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        BlockY = 6 '// set speed.
        Timer1.Enabled = Not Timer1.Enabled '// toggle start/stop of timer.
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        With Me.Panel1 '// shorten code.
            If .Location.Y = 31 Then '// use only .Location.Y since it does not change .Location.X.
                Do Until .Location.Y = 307
                    .Top = .Top + BlockY
                    getCollision(Panel1) '// check for Collision.
                    Application.DoEvents() '// let the getCollision Sub finish up.
                Loop
            End If
            If .Location.Y = 307 Then
                Do Until .Location.Y = 31
                    .Top = .Top - BlockY
                    getCollision(Panel1)
                    Application.DoEvents()
                Loop
            End If
        End With
    End Sub

    Private Sub getCollision(ByVal selectedPanelToCheckForCollision As Panel)
        With rCursorBounds '// only need to set .X and .Y of the rectangle, since width and height is not needed.
            .X = eX : .Y = eY '// set the rectangle location to the location of the Cursor.
        End With
        '// check if Panel.Bounds Intersects With the rectangle of the cursor location.
        If selectedPanelToCheckForCollision.Bounds.IntersectsWith(rCursorBounds) Then
            Timer1.Enabled = False '// …
codeorder 197 Nearly a Posting Virtuoso

See if this helps to get you started with your entries.

Public Class Form1
    Private myAddressBookEntries As New ArrayList '// store your entries.  ArrayList is similar to a ListBox.
    Private arEntry() As String '// String Array to split each entry.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// add item for testing to ArrayList.
        '//--- separate entry items by a char. like ~ or >, etc., which is used to split that item into separate arrays.
        myAddressBookEntries.Add("first name~last name~address~phone~etc.")
        arEntry = myAddressBookEntries(0).ToString.Split("~"c) '// .Split First item into arrays by using  your char..
        '//--- Second item would be: myAddressBookEntries(1)
        '// display result.
        MsgBox(arEntry(0) & vbNewLine & arEntry(1) & vbNewLine & arEntry(2) & vbNewLine & arEntry(3) & vbNewLine & arEntry(4))
    End Sub
End Class

Then simply save to/load from a .txt file.

Unless you show some effort for this project, I will not bother to further help.
.Reason is that this is probably the third project I have offered to help with and you were still not able to figure out how to change text in a Label by Project 2. I will offer help to those that bother to learn, but will not do each and every assignment for someone.

One more thing, please do not use web space just to use web space.
By posting just one of the controls events code should let us know that you have not done anything other than name a few controls.

ndeniche commented: Nice addition. +6
codeorder 197 Nearly a Posting Virtuoso

Use Form2.sSelectedLanguage when loading other Forms since already declared Globally.

swathys commented: Thank You so much ! your explaination really helpful :) +1
codeorder 197 Nearly a Posting Virtuoso

See if this thread helps.

codeorder 197 Nearly a Posting Virtuoso

See if this helps to remove certain lines from a TextBox.

Public Class Form1
    Private arTemp() As String = Nothing '// used to get all lines from TextBox.
    Private sTemp As String = Nothing '// used to add lines back to TextBox.

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '//------------- removeLines(text in line to locate, TextBox to search for text)
        TextBox1.Text = removeLines("daniweb", TextBox1)
    End Sub

    Private Function removeLines(ByVal textInLineToFind As String, ByVal selectedTextBox As TextBox) As String
        arTemp = selectedTextBox.Lines '// set all lines from TextBox into a String Array.
        sTemp = "" '// clear for new input.
        For Each txtLine As String In arTemp '// loop thru all arrays.
            If Not txtLine.Contains(textInLineToFind) Then '// check for line that contains preselected text and skip if .Contains.
                '// if not in line, add to string.
                If Not sTemp = "" Then sTemp &= vbNewLine & txtLine Else sTemp = txtLine
            End If
        Next
        Return sTemp '// return text back to TextBox.
    End Function
End Class
vb2learn commented: Very nice and helpful post by codeorder +1
codeorder 197 Nearly a Posting Virtuoso

Check out this link.

codeorder 197 Nearly a Posting Virtuoso

Leaner Junk C :D

codeorder 197 Nearly a Posting Virtuoso

Since your Dim index As Integer has no value when the application loads, it is set by default to 0.
.This means that any control array that uses (index), only declares one control.

You have to ReDim the control array for the Index not to be outside the bounds of the array.

Private Sub btnAnd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        ReDim btn1(index), btn2(index), chk(index), cbo(index), cbo1(index), txt(index)
        locationy += 40
        CreateRow(locationy)
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Post code that saves and loads from/to your RichTextBox.
AndAlso, if a TextBox loads .rtf text, then add that code as well.

codeorder 197 Nearly a Posting Virtuoso

Managed to find something simpler using My.Computer.Network.UploadFile .

Dim myFTPaddress As String = "ftp://codeorder.net/"
        Dim myFTPuserName As String = "your username here"
        Dim myFTPuserPassword As String = "your login password here"

        Dim myFiles() As String = {"C:\test1.png", "C:\test2.png", "C:\test3.png"} '// files for testing.
        Dim sTemp As String = Nothing '// used to extract only FileName with Extenstion.

        For Each mySelectedFile As String In myFiles '// loop thru your files.
            sTemp = IO.Path.GetFileName(mySelectedFile) '// get only the file name with extension from Full Path.
            '// upload File to website.
            My.Computer.Network.UploadFile(mySelectedFile, myFTPaddress & sTemp, myFTPuserName, myFTPuserPassword)
        Next

        MsgBox("File(s) Upload Successful.", MsgBoxStyle.Information)
codeorder 197 Nearly a Posting Virtuoso

>>InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index
It is because you probably do not have an item selected since your code checks for ListView.SelectedItems(0).SubItems(0).Text .

Private Sub ListView_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView.Click
        If Not ListView.SelectedItems.Count = 0 Then
            '// code here since an item is selected.
        End If
    End Sub
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

'// New Order.
    Private Sub btnNewCustomer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNewCustomer.Click ' button for the new customer
        lstOrder.Items.Clear() '// clear Orders from ListBox.
        lblSubtotal.Text = CDec("0").ToString("c") '// reset SubTotal Price Label.
        '// use that .Text value to add to the other TextBoxes.
        lblTax.Text = lblSubtotal.Text '// Tax.
        lblTotal.Text = lblSubtotal.Text '// Total with Tax included.
    End Sub

For future references, unless the entire code changed, only post the part of the code have issues with. Thanks.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        Select Case e.KeyChar
            Case "1"c, "2"c, "3"c, "4"c, "5"c, "6"c, "7"c, "8"c, "9"c, "0"c, CChar(vbBack) '// your #'s and Backspace.
                e.Handled = False '// allow.
            Case "."c '// Decimal dot.  allow only one.
                If Not TextBox1.Text.Contains(".") Then e.Handled = False Else e.Handled = True
            Case Else
                e.Handled = True '// block.
        End Select
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Is your "Menu items" Label showing "$0.00"?
.Try adding the other Labels in the btnNewCustomer.Click event instead of Label11.

As for the discount, view the last part of my first post and reply back if you have any issues.
.The Boolean should also be declared at Class Level as you recently declared myTotal .

codeorder 197 Nearly a Posting Virtuoso

Not really sure since I have not uploaded anything to FTP with vb.net, but could you just not use:

Dim file() As Byte = System.IO.File.ReadAllBytes("c:\mybackups.zip")
        Dim file2() As Byte = System.IO.File.ReadAllBytes("c:\mybackups2.zip")
        Dim file3() As Byte = System.IO.File.ReadAllBytes("c:\mybackups3.zip")

        Dim strz As System.IO.Stream = request.GetRequestStream()
        strz.Write(file, 0, file.Length)
        strz.Write(file2, 0, file.Length)
        strz.Write(file3, 0, file.Length)

Do let me know if that works.:)

codeorder 197 Nearly a Posting Virtuoso
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
        TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value.ToString '// column 1.
        TextBox2.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString '// column 2.
        TextBox3.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString '// column 3.
        '// etc.
    End Sub
codeorder 197 Nearly a Posting Virtuoso

>>...but the amount keeps on going into the "Menu items" label instead of the 0.00 labels
Probably because "Label11" is your "Menu items" Label.:-O

'// get Total Price.
getTotalPrice(lstItems, lstOrder, Label11)

You can either add more Paramters to your Private Sub getTotalPrice for each Label needed, or remove the last Parameter for the Label.

Private Sub getTotalPrice(ByVal itemsListListBox As ListBox, ByVal orderListListBox As ListBox)
        myTotal = 0
        For Each itm As String In orderListListBox.Items '// loop thru order items.
            '// check if itm is an item in your items ListBox. Items(0)=item 1, Items(1)=item 2, etc.
            If itm = itemsListListBox.Items(0).ToString Then myTotal += myItemPrices(0)
            If itm = itemsListListBox.Items(1).ToString Then myTotal += myItemPrices(1)
            If itm = itemsListListBox.Items(2).ToString Then myTotal += myItemPrices(2)
            If itm = itemsListListBox.Items(3).ToString Then myTotal += myItemPrices(3)
            If itm = itemsListListBox.Items(4).ToString Then myTotal += myItemPrices(4)
            If itm = itemsListListBox.Items(5).ToString Then myTotal += myItemPrices(5)
            If itm = itemsListListBox.Items(6).ToString Then myTotal += myItemPrices(6)
        Next
        lblSubtotal.Text = myTotal.ToString("c") '// Total.
        lblTax.Text = (myTotal * myTax).ToString("c") '// Tax.
        lblTotal.Text = (myTotal + (myTotal * myTax)).ToString("c") '// Total with Tax included.
    End Sub

And use this to call the getTotalPrice Sub.

getTotalPrice(lstItems, lstOrder)

Btw, does StarDucks have good coffee?:D

codeorder 197 Nearly a Posting Virtuoso

Check out this thread about using a BackgroundWorker to run code on a separate thread.
.As for updating, try Application.DoEvents() right after setting your progress.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub DataGridView1_CellContentDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentDoubleClick
        TextBox1.Text = DataGridView1.SelectedCells(0).Value.ToString
    End Sub

Btw, the code from that link is for vb6, not vb.net.

codeorder 197 Nearly a Posting Virtuoso

>>i have this code on my form to update data..if i put yr code..i will get error if i check..
Nice to know.
.Mind sharing what error occurs and possibly which line the error occurs on?

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 RadioButton1.Checked Then MsgBox("RadioButton1 is Checked.")
        If RadioButton2.Checked Then MsgBox("RadioButton2 is Checked.")
    End Sub
codeorder 197 Nearly a Posting Virtuoso

Declare myTotal at Class Level.

Private myTotal As Double = 0

Then reset it in the Private Sub getTotalPrice to "0".

Private Sub getTotalPrice(ByVal itemsListListBox As ListBox, ByVal orderListListBox As ListBox, ByVal priceTotalLabel As Label)
        myTotal = 0
        For Each itm As String In orderListListBox.Items '// loop thru order items.
codeorder 197 Nearly a Posting Virtuoso

Check out this thread.

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Label1.Text = myTotal.ToString("c") '// Total.
        Label2.Text = (myTotal * myTax).ToString("c") '// Tax.
        Label3.Text = (myTotal + (myTotal * myTax)).ToString("c") '// Total with Tax included.
codeorder 197 Nearly a Posting Virtuoso

This does not relate to your question, but I hope it helps.

On Form1 you have a Function: Private Function CurrLanguage(ByVal str As String) which returns Nothing: Return ("") In the case you need to return something as a value to something else, use a Function.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = setTitle(Me.Text)
    End Sub

    Private Function setTitle(ByVal str As String) As String
        Return str & " - added Text"
    End Function
End Class

Otherwise if just setting a value, use a Sub.

Public Class Form1

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

    Private Sub setTitle(ByVal str As String)
        Me.Text = str & " - added Text"
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Add a Public String in Form2 to store the language selected and add a Parameter to the Function.
Form2

Public sLanguageSelected As String

    Private Sub PlayFlash(ByVal selectedCurrentLanguage As String)
        FlashObj.Stop()
        If selectedCurrentLanguage = "LANG_MALAY" Then
            FlashObj.Movie = MultimediaPath & "\Ezy1-agency-Bahasa.swf"
        ElseIf selectedCurrentLanguage = "LANG_ENG" Then
            FlashObj.Movie = MultimediaPath & "\Ezy2-agency-English.swf"
        ElseIf selectedCurrentLanguage = "LANG_CHINESE" Then
            FlashObj.Movie = MultimediaPath & "\Ezy3-agency-Chinese.swf"
        End If
        FlashObj.Play()
    End Sub
    Private Sub frmStep1_AgencyDirect_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ReadPATCfgXML(4)
        Call ReadISTPosMalaysiaXML(0)
        '//=======================
        PlayFlash(sLanguageSelected) '// since language has already been sent from Form1, use that as a Parameter.
        '=======================\\
        Me.Visible = False
        countvar = 0
        tmrShowTimeOutDlg.Enabled = True
    End Sub

Now just set the String in Form2 from Form1.
Form1

Private Function CurrLanguage(ByVal str As String)
        If str = "Malay" Then
            Form2.sCurrentLanguage = "LANG_MALAY"
            ToNextScreen()
        ElseIf str = "English" Then
            Form2.sCurrentLanguage = "LANG_ENG"
            ToNextScreen()
        ElseIf str = "Chinese" Then
            Form2.sCurrentLanguage = "LANG_CHINESE"
            ToNextScreen()
        End If
        Return ("")
        Call resettimer()
    End Function
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private myItemPrices() As Double = {4.95, 6.87, 8.52, 2.99, 0.71, 0.5, 0.99} '// item Prices.
    Private myTax As Double = 0.06 '// Tax used to add to Total Price.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListBox1.Items
            .Add("Small Coffee") : .Add("Medium Coffee") : .Add("Large Coffee") : .Add("Bagel")
            .Add("Cream") : .Add("Sugar") : .Add("Lid")
        End With
        Button1.Text = "New Order"
    End Sub

    '// New Order.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ListBox2.Items.Clear() '// clear Orders from ListBox.
        Label1.Text = CDec("0").ToString("c") '// reset Total Price Label.
    End Sub

    '// items the user can choose from.
    Private Sub ListBox1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.DoubleClick
        If Not ListBox1.SelectedIndex = -1 Then '// check if item is selected since -1 equals a no item selected index.
            ListBox2.Items.Add(ListBox1.SelectedItem) '// add Item to Order List.
            '// get Total Price.
            getTotalPrice(ListBox1, ListBox2, Label1)
        End If
    End Sub

    '// items on the order list. 
    Private Sub ListBox2_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox2.DoubleClick
        If Not ListBox2.SelectedIndex = -1 Then '// check if item is selected since -1 equals a no item selected index.
            ListBox2.Items.Remove(ListBox2.SelectedItem) '// remove item from Order List.
            '// get Total Price.
            getTotalPrice(ListBox1, ListBox2, Label1)
        End If
    End Sub

    Private Sub getTotalPrice(ByVal itemsListListBox As ListBox, ByVal orderListListBox As ListBox, ByVal priceTotalLabel As Label)
        Dim myTotal As Double = 0
        For Each itm As String In orderListListBox.Items '// loop thru order items. …
codeorder 197 Nearly a Posting Virtuoso

You probably need to use a For/Next loop.

Label1.Text = "" '// clear all from receipt.
        For Each bookAdded As String In ComboBox1.Items '// loop thru all items.
            '// check if Not empty, add newLine and book, else just add book.
            If Not Label1.Text = "" Then Label1.Text &= vbCrLf & bookAdded Else Label1.Text = bookAdded
        Next
codeorder 197 Nearly a Posting Virtuoso

Not quite clear. Could you provide just the needed info?

codeorder 197 Nearly a Posting Virtuoso

>>But if the line doesn't starts with the word "leaning daniweb.com" then how will i do it.
Use .Contains("your text") instead of .StartsWith("your text") .

>>Also, how will i do it if there are multiple lines starting with "leaning daniweb.com"
>>And i want to get all the lines starting with leaning daniweb.com
Don't Exit For to exit the loop and add to the .Text in the other TextBox.

TextBox2.Clear() '// clear for new data.
        For Each txtLine As String In TextBox1.Lines '// loop thru all lines in TextBox.
            If txtLine.Contains("leaning daniweb.com") Then '// check if line .Contains a specified String.
                '// If Not empty Then add new line and content, Else just add content.
                If Not TextBox2.Text = "" Then TextBox2.Text &= vbNewLine & txtLine Else TextBox2.Text = txtLine
            End If
        Next
codeorder 197 Nearly a Posting Virtuoso

You can save the file to AppData or LocalAppData Folder.
Those folders are there for such reasons and do not need any administrator permissions on non-administrator systems.

Dim myLocalAppDataFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
        Process.Start(myLocalAppDataFolder)

I would create a Folder just for my application in either one of those folders and use it as needed.

codeorder 197 Nearly a Posting Virtuoso

You could use this to get a specified line from the TextBox.

TextBox2.Text = TextBox1.Lines(2) '// get line 3.

Or you could loop through all the lines.

For Each txtLine As String In TextBox1.Lines '// loop thru all lines in TextBox.
            If txtLine.StartsWith("leaning daniweb.com") Then '// check if line .StartsWith a specified String.
                TextBox2.Text = txtLine '// get line content.
                Exit For '// exit loop since line was located.
            End If
        Next
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Dim myFileName As String = "C:\test.exe"
        IO.File.WriteAllBytes(myFileName, My.Resources.testApp)
        If IO.File.Exists(myFileName) Then Process.Start(myFileName)
xxxferraxxx commented: thanks +1
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

ComboBox1.Items.Clear() '// clear for new input.
        For i As Integer = 0 To 99
            '// since you will get more #'s that are greater than 9, use "If Not" first.
            If Not i < 10 Then ComboBox1.Items.Add(i) Else ComboBox1.Items.Add("0" & i)
        Next
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1
    Private myFile As String = "C:\test.html" '// File for testing.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Show()
        '// send file lines as a Array.
        getLinks(IO.File.ReadAllLines(myFile))
    End Sub

    Private Sub getLinks(ByVal htmlContentLines() As String)
        Dim iStartIndex, iEndIndex As Integer '// used to locate content to extract.
        For Each htmlLine As String In htmlContentLines '// loop thru all lines.
            If htmlLine.Contains("<div class=""tree tree-top""") Then '// locate lines that contain your links.
                iStartIndex = htmlLine.IndexOf("http://") '// get start location of link.
                iEndIndex = htmlLine.IndexOf("""", iStartIndex) '// get end location of link.
                MsgBox(htmlLine.Substring(iStartIndex, iEndIndex - iStartIndex)) '// extract link.
            End If
        Next
    End Sub
End Class