codeorder 197 Nearly a Posting Virtuoso

Until it reached the spring of life.

codeorder 197 Nearly a Posting Virtuoso

(LOL, peel away!!!:D)

If God is not human, but is more human than any human, is that unrealistic?

United

codeorder 197 Nearly a Posting Virtuoso

It is in your Do/Until loop on line 30.

Your WebBrowser does not have time to load a page, set values, and move on to the next link. The Do/Until loop probably goes through all the urls from your file before the first url even has time to load.

I would load your file into an ArrayList, send the first item(url path from file) to the WebBrowser, let it load, set values, and THEN move on to the next item in the ArrayList until the last item has been loaded.

Btw, it does seem like a spam bot, just posting multi-posts on different sites without being able to know what the content on each site already is. It could possibly be a Holidays Greetings bot, to send "Merry Christmas from..." to all of your friends. Or just simply for testing, although I do doubt as much.

codeorder 197 Nearly a Posting Virtuoso

... as rows of flowers in a field.

codeorder 197 Nearly a Posting Virtuoso

You could also use a ArrayList to store the FullPath of a file.
.Check out this thread for some basic info on using a ArrayList.

codeorder 197 Nearly a Posting Virtuoso

(roflmaooooo, so is mine :D)

If I break down the word "oxymoron", I get an "ox", "y" I do not know exactly, but I must be a "moron". :twisted:

Passion

codeorder 197 Nearly a Posting Virtuoso

"S.O.B.!!!":D, if spoken as typed, is more than likely a cacology.

Iced

codeorder 197 Nearly a Posting Virtuoso

I'm not sure if I can acquiesce with having a proper sentence for this word, but I hope this will fool everyone that I have a complete understanding of how exactly the word is used in a sentence. :D

Understanding

codeorder 197 Nearly a Posting Virtuoso

If a fool is full, would that make the full a fool?

Judge

codeorder 197 Nearly a Posting Virtuoso

Correct.

codeorder 197 Nearly a Posting Virtuoso

Change MsgBox(ex.Message) to TextBox1.Clear in the Try/Catch of my previously posted code.

Try
            '// run all code here that can/might cause an error.
        Catch ex As Exception
            '// add code here to correct the error if it does occur.
        End Try
codeorder 197 Nearly a Posting Virtuoso

(this thread is not the only reason I am part of this community, avatar will remain)

You know how they say "Something just flew in my eyes"?
.Well, an airplane just flew in yours!

codeorder 197 Nearly a Posting Virtuoso

Ok. With the above posted code, using MsgBox(arTemp(0)) , you will get "one", MsgBox(arTemp(1)) will get you "two", and MsgBox(arTemp(2)) will get you "three" from the arTemp String Array.
.Since in my code I had MsgBox(arTemp(3)) , that Array does not exist in arTemp, which should return a "four", therefore you get the error of "Index was outside the bounds of the Array".

Basically saying, that error will let you know when you are trying to locate something that is not there, it is "outside the bounds", bounds meaning Array length/count.

codeorder 197 Nearly a Posting Virtuoso

Are you pointing your "eyes" at me?:D
(btw, was that a personal comment, or just pointing your "eyes" at me to change my avatar?)

codeorder 197 Nearly a Posting Virtuoso

"I'm not bug-eyed, you just have small eyes."

codeorder 197 Nearly a Posting Virtuoso

>>it says "Index was outside the bounds of the arrays"

This usually occurs when your (i) goes over the Array length/count.
.Here's an example.

Try
            Dim arTemp() As String = {"one", "two", "three"}
            MsgBox(arTemp(3))
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try

Since Arrays start at 0 not 1, the arTemp(3) is actually Array 4, which is not included in my declared Array. Therefore you will get the error message.

codeorder 197 Nearly a Posting Virtuoso

"I got a cat in the bag!!!":D

codeorder 197 Nearly a Posting Virtuoso

Try this thread, might be easier than you think.:)
.There is also another post of mine in that thread, just above the linked one.
Hope it helps.

ninjatalon commented: thanks +3
codeorder 197 Nearly a Posting Virtuoso
Private Sub MonthCalendar1_DateChanged(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DateRangeEventArgs) Handles MonthCalendar1.DateChanged
        '// if you have the months from January to December in your ComboBox, then this should work.
        ComboBox1.SelectedIndex = MonthCalendar1.SelectionStart.Month - 1
    End Sub

You might need to set the "MaxSelectionCount" to 1 in the MonthCalendar's Properties.

codeorder 197 Nearly a Posting Virtuoso

You will also need a Timer to keep up with the Time.
As for the clock it's self, you will probably have to draw it, possibly inside a Panel.

codeorder 197 Nearly a Posting Virtuoso
TextBox1 = ""

The above line will cause this error: Value of type 'String' cannot be converted to 'System.Windows.Forms.TextBox'. Can easily be fixed by setting the .Text of the TextBox as the String, and not the TextBox it's self.

TextBox1.Text = ""

Without your code that generates the error, it is difficult for someone to exactly recreate it.

codeorder 197 Nearly a Posting Virtuoso

Have you tried running the BackgroundWorker from Form1, instead of calling the loadForm2 Sub?

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Public Class Form1

    Private Sub TxbPostcode_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxbPostcode.LostFocus
        Dim txtValidator As New txtValidation
        If Not txtValidator.validateTextBox(TxbPostcode) = True Then
            MsgBox("Postcode not OK." & vbNewLine & " Needs to have 2 letters and 4 numbers seperated by a space.: EB 3698", MsgBoxStyle.Critical)
            TxbPostcode.Clear() : TxbPostcode.Select()
        End If
    End Sub
End Class

Public Class txtValidation
    Public Function validateTextBox(ByVal selectedTextBoxToValidate As TextBox) As Boolean
        With selectedTextBoxToValidate
            If .Text = "" Then Return False '// if no text.
            If Not .TextLength = 7 Then Return False '// if not correct length.
            If Not Char.IsLetter(.Text(0)) OrElse Not Char.IsLetter(.Text(1)) Then Return False '// if not first 2 char. are letters.
            If Not .Text(2) = " " Then Return False '// if not 3rd char. is space.
            '// if not last 4 char. are #'s.
            If Not Char.IsDigit(.Text(3)) OrElse Not Char.IsDigit(.Text(4)) OrElse Not Char.IsDigit(.Text(5)) OrElse Not Char.IsDigit(.Text(6)) Then Return False
            '// if not less/greater than amount set.
            If CInt(.Text.Substring(3)) < 1000 OrElse CInt(.Text.Substring(3)) > 9999 Then Return False
        End With
        Return True '// if all cleared.
    End Function
End Class
codeorder 197 Nearly a Posting Virtuoso

See if this helps.
2 Forms(ProgressBar on Form1)

Public Class Form1
    '// Timer to keep status of the ProgressBar.Value.
    Private WithEvents tmrStatus As New Timer With {.Interval = 100, .Enabled = True}

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '// Form1 loading code here if needed.
        '// Run the following code last in Form1_Load.
        Me.Show() '// display Form before running the ProgressBar code, else it will run the code before Form1 displays.
        Form2.loadForm2(ProgressBar1) '// run the ProgressBar code.
    End Sub

    Private Sub tmrStatus_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrStatus.Tick
        If ProgressBar1.Value = 100 Then
            tmrStatus.Enabled = False
            Me.Hide() '// should be "Me.Close" if done with the Form.
            '// since all the code was loaded, you can close the ProgressBar Form and load the Form needed.
            Form2.Show()
        End If
    End Sub
End Class
Public Class Form2

    Public Sub loadForm2(ByVal ProgressBarToUse As ProgressBar)
        With ProgressBarToUse
            .Value = 0
            Threading.Thread.Sleep(450) '// FOR TESTING.
            '// run some code lines here.
            .Value = 10
            Threading.Thread.Sleep(450) '// FOR TESTING.
            '// run some more code lines here.
            .Value = 50
            Threading.Thread.Sleep(450) '// FOR TESTING.
            '// ""
            .Value = 70
            Threading.Thread.Sleep(450) '// FOR TESTING.
            '// ""
            .Value = 100
        End With
    End Sub
End Class

I ended up using a Timer since in my sample project's Properties, I have "when Form1 closes" to terminate the app..

codeorder 197 Nearly a Posting Virtuoso

I would use Labels(AutoSize=False, for resizing) instead of Panels. Maybe even a PictureBox.
.The reason for Labels/PictureBoxes, is that a Panel is a container, not just a basic control. I'm personally uncertain if it takes more out of an app. to load/design/draw a Panel, than it would to do the same for a Label/PictureBox, but since the Panel is a more complex control overall, my guesses are that it will use up more resources.

codeorder 197 Nearly a Posting Virtuoso

Bush was scared. Was there something lurking?

codeorder 197 Nearly a Posting Virtuoso

(:D, so does a wave.(wink))

Is that my shadow or is it Homer Simpson's shadow? "Mmmm"

codeorder 197 Nearly a Posting Virtuoso

(if that is your personal email address, get ready for me to spam it:D. Honestly, if it is, use the "Flag Bad Post" under your username and notify the moderators to edit it with something else.)

I had to concatenate my day's doings, to figure out the reason why god had me live another day.

Perception

codeorder 197 Nearly a Posting Virtuoso

Bush said, " What is after the 'another' ".

codeorder 197 Nearly a Posting Virtuoso

Googly eyes.
Btw, when they shake you, do you see in 360 degree view?

codeorder 197 Nearly a Posting Virtuoso

One day, frog said something to bush.

codeorder 197 Nearly a Posting Virtuoso

This story got so twisted, it is not even funny. :D
I'll top off the story again, before a new beginning.

The prince and princess met from a escort service the princess ran.
Her maids ran off with the prince just before the prince and princess' date.
Princess killed herself and the prince got killed by the maids because the princess killed herself. The end.:D

(That's 2 stories with people dieing:'(. At least they all died for good reasons.:D)

Let's start again
and try to stick with the story of the previous post, until someone kills them all again:D.

A frog and a bush were friends.

codeorder 197 Nearly a Posting Virtuoso

The prince asked her maids of service.

codeorder 197 Nearly a Posting Virtuoso

Granted. Your head swells up bigger than your house while you are in it and it crushes you in the process.

I wish I was a bra.

codeorder 197 Nearly a Posting Virtuoso

The princess was weird. She had three...

codeorder 197 Nearly a Posting Virtuoso

See if this helps.

Private Sub exportProcedure(ByVal fileName As String)
        Try

            '// your entire code here to get value from database.

            Dim sTemp As String = "my database value goes here"
            IO.File.WriteAllText(fileName, sTemp) '// save file.
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
codeorder 197 Nearly a Posting Virtuoso

>>I kinda forgot to ask if there was a way to add up all the totals for a grand total, to see how much profit was made for that one day, is that possible?

Without items in the ListView, you cannot get a "how much profit was made for that one day", now can you?

The grand total code should be placed in a Button.Click or can even be added to the same Sub that adds items to the ListView. If the same Sub, I would remove the MsgBox and have a Label instead. Also, make sure it is right after the add items code and not before.

codeorder 197 Nearly a Posting Virtuoso

My special skill, is knowing keyboard shortcuts for smileys.:D

Address

codeorder 197 Nearly a Posting Virtuoso

since literally, there was no one else.:D

codeorder 197 Nearly a Posting Virtuoso

fourth: I will start a new thread for each question that does not relate to the topic of this thread.

codeorder 197 Nearly a Posting Virtuoso

To save and load a ListView with columns, view this thread.

To get a total for the day, see if this helps.

With ListView1
            If Not .Items.Count = 0 Then '// check if items in ListView.
                Dim dTotal As Double = 0
                For Each itm As ListViewItem In .Items '// loop thru items.
                    '// check if column 4 item has a value and add it to your total.
                    If Not itm.SubItems(3).Text = "" Then dTotal += CDbl(itm.SubItems(3).Text)
                Next
                MsgBox(dTotal.ToString("c")) '// display result.
            End If
        End With

Making a "repeating program", whatever that is, add a Timer, enable it on Form1_Load and place a MsgBox in the Timer's_Tick event.

codeorder 197 Nearly a Posting Virtuoso

(Guess that robbing a smiley bank and making it home with a smiley in the bag:D, being chased in high speed chases that end with no crashes and you get back home to your smiley in the bag, and diving with no parachute:D to end up with no scratches whatsoever, would be quite boring.:twisted:)

Granted. You complete your operating system, only to find out that Microsoft and every other operating system designing companies, have all the copyrights to each and every idea you invested into your operating system.

If I were ever to be a smiley, I wish I knew what type of smiley I would be.(of course, before someone's decides to eat me, again.:D)

codeorder 197 Nearly a Posting Virtuoso

To be kind to yourself, you have to be kind to others.

Occasion

codeorder 197 Nearly a Posting Virtuoso

Not quite clear if you want to just pick random numbers or get the possibility equation.

If possibility, see if this helps.

MsgBox("The possiblily to win the loterry by drawing 6 numbers from 1 to 49," & vbNewLine & _
               "is 1 in " & CDbl(49 ^ 6).ToString("#,###,###,###,###") & ".")
codeorder 197 Nearly a Posting Virtuoso

Before you can run the provided code, you will need a File which loads all UPCs and Prices from it to 2 ArrayLists.
I saved mine to: Private myUPCsAndPricesFile As String = "C:\myUPCsAndPricesFile.txt" .

The file content should contain both UPC and individual Price for each item, and should be separated by a single space (" ") .

0921115150 3.50
2221001501 17.25
6652300415 3.25
2221001501 20.00
0255541028 1.85
0921115150 32.56
2221001501 25.26

As for what makes the app. tick, see if this helps.
1 ListView, 2 TextBoxes(TextBox1=UPC, TextBox2=Quantity), 1 Button

Public Class Form1
    Private myUPCsAndPricesFile As String = "C:\myUPCsAndPricesFile.txt"
    Private arlUPC, arlPrices As New ArrayList '// store UPCs and Prices in 2 ArrayLists.

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With ListView1 '// customize ListView.
            .Columns.Add("UPC", 100) : .Columns.Add("Quantity", 100) : .Columns.Add("Price", 100) : .Columns.Add("Total", 100)
            .View = View.Details : .FullRowSelect = True
        End With
        If IO.File.Exists(myUPCsAndPricesFile) Then '// check if File.Exists.
            For Each fileLine As String In IO.File.ReadAllLines(myUPCsAndPricesFile) '// loop thru all file lines.
                If Not fileLine = "" Then '// make sure there is a value in file line.
                    arlUPC.Add(fileLine.Split(" "c).GetValue(0)) '// .Split file line by the " "(space), and add first value to the UPC ArrayList.
                    arlPrices.Add(fileLine.Split(" "c).GetValue(1)) '// add second value to the Prices ArrayList.
                End If
            Next
        Else '// if File does not Exist.
            MsgBox("This application will not run without the system file:" & vbNewLine & myUPCsAndPricesFile, MsgBoxStyle.Critical)
            Application.Exit()
        End If
        Button1.Text = "Add New"
    End …
codeorder 197 Nearly a Posting Virtuoso

(jingda, you change your avatar quicker than a chameleon changes colors of 4th of July.)

Roadkill :D

codeorder 197 Nearly a Posting Virtuoso

, because everything is like nothing else.

codeorder 197 Nearly a Posting Virtuoso

I tend to geek out when something worth investing my time into catches my attention.

Reality

codeorder 197 Nearly a Posting Virtuoso

Granted. You build a super computer that calculates all reasonable solutions, and right before completion, you test it only to find out that you will not live to see tomorrow. This due to inheriting some sort of disease for not sleeping, eating, or taking care of your self while in the process of working on the super computer project.

I wish for smooth sailing throughout my life.

codeorder 197 Nearly a Posting Virtuoso

^ Doesn't know the letters in the alphabet, since D comes after ABC, not "s".
< Just farted and had to leave the room for 2 hours.
V Is wondering what smells like baked brownies.