Click here to Skip to main content
15,909,498 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Multithreading slower? Pin
Luc Pattyn6-May-10 13:57
sitebuilderLuc Pattyn6-May-10 13:57 
GeneralRe: Multithreading slower? Pin
NikWing6-May-10 14:21
NikWing6-May-10 14:21 
AnswerRe: Multithreading slower? Pin
Luc Pattyn6-May-10 6:14
sitebuilderLuc Pattyn6-May-10 6:14 
AnswerRe: Multithreading slower? Pin
supercat96-May-10 6:54
supercat96-May-10 6:54 
GeneralRe: Multithreading slower? Pin
NikWing6-May-10 7:56
NikWing6-May-10 7:56 
GeneralRe: Multithreading slower? Pin
supercat96-May-10 9:11
supercat96-May-10 9:11 
GeneralRe: Multithreading slower? Pin
NikWing7-May-10 0:50
NikWing7-May-10 0:50 
QuestionMaximum number in an array? Pin
Adam Wike6-May-10 4:51
Adam Wike6-May-10 4:51 
I need to make a program that generates 15 random numbers as an array and then lists them in a listbox. I also need to be able to display the maximum and minimum in a label. Heres what I've got so far...

Public Class Form1
    Dim strNumbers(14) As String


    Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
        Dim intRandom As New Random()
        Dim intLoop As Integer

        lstOutcome.Items.Clear()

        For intLoop = 0 To strNumbers.Length - 1
            lstOutcome.Items.Add(intRandom.Next(1, 100))
        Next intLoop

    End Sub

    Private Sub btnMaximum_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMaximum.Click
        Dim intLoop As Integer
        Dim intMax As Integer


        For intLoop = 0 To strNumbers.Length - 1
            intMax = strNumbers(intLoop)
            If intMax < strNumbers(intLoop) Then
                intMax = strNumbers(intLoop)
            End If
        Next intLoop

        lblMinMax.Text = intMax
    End Sub
End Class


I've got the 15 random numbers in the listbox. I just cant figure out why my maximum code isnt working. Any tips would be awesome right now...
AnswerRe: Maximum number in an array? Pin
Luc Pattyn6-May-10 5:04
sitebuilderLuc Pattyn6-May-10 5:04 
AnswerRe: Maximum number in an array? Pin
dan!sh 6-May-10 5:06
professional dan!sh 6-May-10 5:06 
GeneralRe: Maximum number in an array? Pin
Adam Wike6-May-10 7:36
Adam Wike6-May-10 7:36 
GeneralRe: Maximum number in an array? Pin
Adam Wike7-May-10 4:08
Adam Wike7-May-10 4:08 
QuestionOutlook Addin Pin
Dominick Marciano5-May-10 10:48
professionalDominick Marciano5-May-10 10:48 
QuestionAddIn stopped working Pin
Sonhospa5-May-10 2:38
Sonhospa5-May-10 2:38 
AnswerRe: AddIn stopped working Pin
tosch5-May-10 3:43
tosch5-May-10 3:43 
GeneralRe: AddIn stopped working Pin
Sonhospa5-May-10 6:01
Sonhospa5-May-10 6:01 
AnswerRe: AddIn stopped working Pin
Johan Hakkesteegt5-May-10 21:23
Johan Hakkesteegt5-May-10 21:23 
GeneralRe: AddIn stopped working Pin
Sonhospa6-May-10 7:30
Sonhospa6-May-10 7:30 
NewsConnecting, but still something wrong Pin
Sonhospa6-May-10 9:49
Sonhospa6-May-10 9:49 
GeneralRe: Connecting, but still something wrong Pin
Johan Hakkesteegt6-May-10 20:39
Johan Hakkesteegt6-May-10 20:39 
GeneralRe: Connecting, but still something wrong Pin
Sonhospa6-May-10 22:21
Sonhospa6-May-10 22:21 
QuestionFilesize Conversion Pin
Dayekh5-May-10 2:29
Dayekh5-May-10 2:29 
AnswerRe: Filesize Conversion Pin
DaveAuld5-May-10 2:57
professionalDaveAuld5-May-10 2:57 
GeneralRe: Filesize Conversion Pin
Luc Pattyn5-May-10 3:14
sitebuilderLuc Pattyn5-May-10 3:14 
GeneralRe: Filesize Conversion Pin
Dayekh5-May-10 3:51
Dayekh5-May-10 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.