battle programmers alliance

battle programminga forum for elite programmerswith extreme will powerto sharpen theire skills
 
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in
Search
 
 

Display results as :
 
Rechercher Advanced Search
Latest topics
» android mobile app dev APK
Sun Jul 15, 2018 6:20 pm by Moti Barski

» android studio execises
Mon Jul 09, 2018 1:43 pm by Moti Barski

» problem with firebase authentication
Thu Jun 28, 2018 9:52 am by Moti Barski

» text art canvas
Wed Jun 20, 2018 8:55 pm by Moti Barski

» links/suggestions to become a programmer
Mon May 07, 2018 11:01 pm by Moti Barski

» java eclipse oxygen grimoire
Thu May 03, 2018 8:24 pm by Moti Barski

» forum logo by tf monkey
Wed May 02, 2018 10:17 pm by Moti Barski

» java and MySQL
Mon Apr 30, 2018 3:02 pm by Admin

» mini A.I puzzles
Mon Apr 23, 2018 11:38 am by Moti Barski

July 2018
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
293031    
CalendarCalendar
Social bookmarking
Social bookmarking digg  Social bookmarking delicious  Social bookmarking reddit  Social bookmarking stumbleupon  Social bookmarking slashdot  Social bookmarking yahoo  Social bookmarking google  Social bookmarking blogmarks  Social bookmarking live      

Bookmark and share the address of battle programmers alliance on your social bookmarking website
Share | 
 

 vb.net get different random numbers

Go down 
AuthorMessage
Moti Barski

avatar

Posts : 154
Join date : 2011-08-02

PostSubject: vb.net get different random numbers   Thu Aug 01, 2013 9:46 pm

this program outputs 5 different random numbers out of the range 1 - 100 (including 100)

form controls :
button
textbox
Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim bool1 As Boolean
        Dim random As New Random()
        Dim x As Integer
        For index = 1 To 5
            bool1 = True
            While bool1
                x = random.Next(1, 101)
                If Not TextBox1.Text.Contains(x.ToString()) Then
                    TextBox1.Text &= x.ToString() & " "
                    bool1 = False
                End If
            End While
        Next
    End Sub
End Class
lol! 

_________________
MB over and out
Back to top Go down
View user profile
 
vb.net get different random numbers
Back to top 
Page 1 of 1
 Similar topics
-
» Random Oddities
» How to click random checkbox
» Random clapping way to center/destress
» [Hỏi đáp] Tỉ lệ random
» Put a Dent in Your Debt Sweepstakes *ABA-accredited law schools only*

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: battle programming-
Jump to: