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.
1 TextBox, 1 Button, 3 Labels

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Select Case TextBox1.Text '// check value in TextBox.
            Case "5" '// if 5.
                Label1.Text = "15000"
                Label2.Text = "15%"
                Label3.Text = CStr(15000 * 0.1) '// multiply 15000 by .1 to get 10%.
            Case "6" '// if 6.
                Label1.Text = "25000"
                Label2.Text = "20%"
                Label3.Text = CStr(25000 * 0.1) '// CStr converts the #'s to String value for adding it as .Text.
            Case Else '// if anything else.
                MsgBox("Incorrect grade entered.")
        End Select
    End Sub
codeorder 197 Nearly a Posting Virtuoso

To NOT make your life a living hell, try to find a job that interests you, not find a job that pays well. You'll live better and will not consider life as "hell". Life should never be considered that, it just makes our ancestors look like they planned wrong for the future of humanity.

codeorder 197 Nearly a Posting Virtuoso

See if this helps to get individual values from a CSV file.

Public Class Form1
    Private myFile As String = "C:\test.csv" '// your file.
    Private arlCSVlines As New ArrayList '// similar to a ListBox.
    Private arTemp() As String = Nothing '// String Array to .Split each line.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If IO.File.Exists(myFile) Then
            For Each fileLine As String In IO.File.ReadAllLines(myFile)
                arlCSVlines.Add(fileLine) '// add all lines to the ArrayList.
            Next
        End If
        '// if you do not need the header line, remove it.
        arlCSVlines.RemoveAt(0) '// remove first item from ArrayList.
        '// .Replace all the double quotes and .Split the line into arrays by the comma.
        arTemp = arlCSVlines(0).ToString.Replace("""", "").Split(","c) '// line 1 from file.
        '// display results for line 1.
        MsgBox(arTemp(0) & vbNewLine & arTemp(1) & vbNewLine & arTemp(2) & vbNewLine & arTemp(3) & vbNewLine & arTemp(4) & vbNewLine & arTemp(5))
        arTemp = arlCSVlines(1).ToString.Replace("""", "").Split(","c) '// line 2 from file.
        '// display results for line 2.
        MsgBox(arTemp(0) & vbNewLine & arTemp(1) & vbNewLine & arTemp(2) & vbNewLine & arTemp(3) & vbNewLine & arTemp(4) & vbNewLine & arTemp(5))
        End '// exit while testing.
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

Did I just barf that up?

codeorder 197 Nearly a Posting Virtuoso

(12 hours 13 minutes later)
Still at it? I think he missed a spot though.

codeorder 197 Nearly a Posting Virtuoso

(12 hours later)
Is that hawk still peeing on my snow?

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

The darkness dissolved and life was created.

codeorder 197 Nearly a Posting Virtuoso

^ Should have pointed the "V" to the "<".
< Am not a "porkyman" :'(
V Checking out the toes on a camel.

codeorder 197 Nearly a Posting Virtuoso

Change BlockY = 6 '// set speed. to any speed needed just before starting the Timer.
Glad I could help otherwise.:)

codeorder 197 Nearly a Posting Virtuoso

Rules:

  • A sentence must contain any 2 words from the previous post.
  • A sentence can only be 5, 6, or 7 words in length. No more, no less.
  • No posting twice in a row.


Let's start...
In the beginning there was light

codeorder 197 Nearly a Posting Virtuoso

^ Waited 2 months for a reply.
< Took 2 months to reply.
V Did not brush their teeth for 2 months.

codeorder 197 Nearly a Posting Virtuoso

Just because you wrote "Hawk" whilst having a pee on my snow, does not mean I'm still not hungry.

codeorder 197 Nearly a Posting Virtuoso

I'm not cold.

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 to figure out how Exit Sub works.

Public Class Form1
  
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Text = "Exit Sub."
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Me.Text = "Exit Sub." Then
            Me.Text = "Do not Exit Sub." '// set new text for testing when clicking Button again.
            Exit Sub '// skip the rest of the code within this Sub(Private Sub Button1_Click), in this case the code for the MsgBox.
        End If
        MsgBox("Sub was not Exited.")
    End Sub
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Sub SaveCustomerDbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveCustomerDbtn.Click
        If txtCustomerSurnameOS.Text = "" Then
            MsgBox("Please Input Surname", MsgBoxStyle.Critical)
            txtCustomerSurnameOS.Focus()
            Exit Sub '// Skip remaining code.
        End If
        If txtCustomerForenameOS.Text = "" Then
            MsgBox("Please Input Forename", MsgBoxStyle.Critical)
            txtCustomerForenameOS.Focus()
            Exit Sub '// Skip remaining code.
        End If
        If txtCustomerAddressOS.Text = "" Then
            MsgBox("Please Input Address", MsgBoxStyle.Critical)
            txtCustomerAddressOS.Focus()
            Exit Sub '// Skip remaining code.
        End If
        If txtCustomerTownOs.Text = "" Then
            MsgBox("Please Input Town", MsgBoxStyle.Critical)
            txtCustomerTownOs.Focus()
            Exit Sub '// Skip remaining code.
        End If
        If txtCustomerPostcodeOs.Text = "" Then
            MsgBox("Please Input Post Code", MsgBoxStyle.Critical)
            txtCustomerPostcodeOs.Focus()
            Exit Sub '// Skip remaining code.
        End If
        If Not IsNumeric(txtCustomerTeleNoOs.Text) Then
            MsgBox("Please Input Telephone No", MsgBoxStyle.Critical)
            txtCustomerTeleNoOs.Focus()
            Exit Sub '// Skip remaining code.
        End If
        '// if all TextBoxes have values, then proceed.
        dataAccess.CreateCustomer(txtCustomerSurnameOS.Text, txtCustomerForenameOS.Text, txtCustomerAddressOS.Text, txtCustomerTownOs.Text, txtCustomerPostcodeOs.Text, txtCustomerTeleNoOs.Text)
        MsgBox("Customer saved", MsgBoxStyle.Information)
        Me.Close()
        frmPrintOrderScreen.Show()
    End Sub
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

Eekhoorn, overlooking your original posted code and seeing this, seems that you are trying to get only the file name with extension from a file's full path.

For Each file In foundFiles
                Testlength = file.Count
                Test = file.LastIndexOf("\")
                Test1 = Test + 1
                FleNmLength = Testlength - Test1
                FileName = file.Substring(Test1, FleNmLength)
                ' Debug.WriteLine(FileName)
                FileNames(i) = FileName
                ' Debug.WriteLine(FileNames(i))
            Next

If that is the case, then you can simply use this to get only the filename with extension from a full file path.

Dim myCoolFile As String = "C:\Some Folder\Some SubFolder\Some FileName.someExtension"
        MsgBox(IO.Path.GetFileName(myCoolFile))

And this to get only the file name without the file extension.

Dim myCoolFile As String = "C:\Some Folder\Some SubFolder\Some FileName.someExtension"
        MsgBox(IO.Path.GetFileNameWithoutExtension(myCoolFile))

Even though thread is solved, I hope this helps. :)

codeorder 197 Nearly a Posting Virtuoso

Also, see if this helps.

Public Class Form1
    Public topping1, topping2, drink As String '// Global declared Strings.
  
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// set values to your Strings.
        '//-- if needed to set from other Forms, use: Form1.topping1="topping here", etc.
        topping1 = "Cheese"
        topping2 = "Steak"
        drink = "Water"
        '// set the preset values in RichTextBox on Form1_Load, when Form Loads.
        RichTextBox1.Text = topping1 & vbNewLine & topping2 & vbNewLine & drink
    End Sub
End Class
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
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 "-"c '// Minus/Subtract sign.  allow only as first char.
                If TextBox1.SelectionStart = 0 AndAlso 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

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

What exactly are you trying to do?
.Load file, modify certain lines, and save file back?

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

Ahhhh, this is the vb4/5/6 forum... :)

Was not until I flagged it as a bad post for the vb.net forum and noted to the moderators that it should be moved to this forum. Hope it helps "everyone". :)

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

See if this helps.

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        'Static count As Integer = 1
        If PictureBox1.Location.X < 20 AndAlso PictureBox2.Location.X < 20 Then  'if we haven't reached the stopping point
            PictureBox1.Left += 5              '  Move the Picturebox 100 units to the right.
        Else                                   'otherwise
            Timer1.Enabled = False
            '  PictureBox1.Hide() '  Disable the timer for this example
        End If
        'If count = 5 Then
        '    Timer1.Enabled = False
        '    count = 1 '// reset count since it is Static and will carry values over for next time.
        'End If
        'count += 1
    End Sub

Only thing I saw wrong was that you were using & instead of AndAlso . AndAlso:D, not resetting your Static Integer.

codeorder 197 Nearly a Posting Virtuoso

Even though this thread is Solved, hope this helps.

Check out the first posted code from this link.
http://stackoverflow.com/questions/234774/custom-button-captions-in-net-messagebox

Just adding my 2 cents worth.
I would personally create my own MsgBox clone from a Form since I can have total control over it.

Also, use .ShowDialog instead of .Show .

Dim myMsgBox As New Form1
        myMsgBox.ShowDialog()