Offistart - Virtual Offices, Office Space, Business Support Services
*Home>>>Call Handling

Visual Basic question?


im trying to print the highest and lowest number of a 10 number array to 2 label when i click two buttons. max and min
heres what i have so far:

Public Class Form1

Structure Numbers
Dim intminnumber As Integer
Dim intmaxnumber As Integer
End Structure


Private Sub btnnumbers_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnnumbers.Click
Dim intrandom As Integer
Dim intmax As Integer
Dim intmin As Integer

Dim intrandomnumbers(9) As Integer '10 random numbers


For i As Integer = 0 To 9 Step 1
intrandom = Int(99 * Rnd()) + 1
intrandomnumbers(i) = intrandom
Me.ListBox1.Items.Add(intrandomnumbers(i...
Next




End Sub
End Class



the two buttons are called btn max, and btnmin
the labels are lblmax, and lblmin

You will need to find out which is the lowest and highest random number in the list. Add these two lines to the For Loop after you get intrandom:

If intrandom > intmax Then intmax = intrandom
If intrandom < intmin Or intmin = 0 Then intmin = intrandom

You then need to use your structure so that you can decided when and where to assign the values. Add these lines after the For Loop:

Dim numStruct As Numbers
numStruct.intmaxnumber = intmax
numStruct.intminnumber = intmin

Tags
  Commercial Space   Office Space   Business Services   Business Address   Call Forwarding   Call Handling   Answering Service   Telephone Answering   Mail Forwarding   Virtual Address   Virtual Assistant   Virtual Business
Related information
  • Pulled shoulder muscle... Can it turn to chronic?

    Yes rest is good advice. What's happening is you strained or maybe even tore the muscle a little. Every time you use it, it causes more swelling. The only way it would become chronic is if it ...

  • OMG why the f*ck is this happening??!! Problem with these two girls, one of their bf's, and my half brother!!!

    wow ummm sorry 1st of all that this happend 2 u and tell the girl that ur half brother liked that shes beautiful or something but tell her that there s the right guy 4 her but hes not around here o...

  • Does any of this sound somewhat familiar?

    Funny thank goodness I do not drink.

    ...
  • The 3 hamster babies i asked 2 questions about....?

    Well you will need a high protein formula. You could call a vet and ask if s/he has something for them, or you could try to find infant formula (cows milk is no good and will kill them). You'l...

  • Looking for a book?

    ...

  • I feel like a horrable person, am i the bad one?

    No u are not the bad person, but u should grow up and stop pouting whenever u cant get ur way. U should have never let him ride with ur sister without u. Only u know ur sister. She is the one th...

  • The medical group lost my medical chart. What should I do?

    Sadly, too often medical charts get lost when being filed or transferred between offices. Usually the chart is finally discovered. Start keeping a written record. Send a registered letter to the...

  • What would u do...?? I'm really angry right now!!?

    tell her that wen she is a medially trained person u will listen to her and until then keep her trap shut. sont take her to see her either thats an absolutely vile thing to say

    ...
  •  

    Categories--Copyright/IP Policy--Contact Webmaster