hello, hopefully someone can help me solve my problem, go easy on me though, i have been working with vb for even a week..but i am trying to get 2 different integers which both have a different min and max value, once i set that i would want to start a loop for both to constantly change its integer so i can get two different numbers every time which then will represent x, y coordinates changing to random coordinates.
I've been trying to make it so every loop the int will +200 then /2 which will produce a random number but everything i have tired has not been working.
The reason i need the x,y for form1 to change everytime it load is because i am making an application to prank people, its pretty much just spams windows, which later i will add pictures to. and the reason i need a min and max for the integer is because i dont want the windows to load off the page.
but the reason this isnt working is just yes they do load randomly...but in a diagonal path starting from top left top bottom right, really no way els to explain. hopefully someone can help
I've tried this but its not truly random since the processor is picking out the numbers:
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim New1 As New Form1
New1.Show()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim RndNum As New Random(Now.Millisecond)
Dim x As Integer
x = RndNum.Next(0, 500)
Dim RndNumY As New Random(Now.Millisecond)
Dim y As Integer
y = RndNumY.Next(0, 750)
Me.WindowState = FormWindowState.Normal
If Timer1.Enabled = True Then Me.Location = New Point(x - 100, y - 100)
End Sub
I've been trying to make it so every loop the int will +200 then /2 which will produce a random number but everything i have tired has not been working.
The reason i need the x,y for form1 to change everytime it load is because i am making an application to prank people, its pretty much just spams windows, which later i will add pictures to. and the reason i need a min and max for the integer is because i dont want the windows to load off the page.
but the reason this isnt working is just yes they do load randomly...but in a diagonal path starting from top left top bottom right, really no way els to explain. hopefully someone can help
I've tried this but its not truly random since the processor is picking out the numbers:
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim New1 As New Form1
New1.Show()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim RndNum As New Random(Now.Millisecond)
Dim x As Integer
x = RndNum.Next(0, 500)
Dim RndNumY As New Random(Now.Millisecond)
Dim y As Integer
y = RndNumY.Next(0, 750)
Me.WindowState = FormWindowState.Normal
If Timer1.Enabled = True Then Me.Location = New Point(x - 100, y - 100)
End Sub