Jump to content
  • Revista PROGRAMAR: Já está disponível a edição #60 da revista programar. Faz já o download aqui!

cagueca

Geredor de chaves para euromilhoes

Recommended Posts

cagueca

Boas :

Pessoal estou a iniciar mesmo no vb 2008 e nao tenho experiencia nenhuma ..

O primeiro programa que estou a criar e um geredor de chaves para euromilhoes so mesmo para ver se comeco a perceber um bocado mais disto ..

Agora problemas .. o meu programa nao poe por ordem os numeros e eles muitas vezes repetem se o que nao pode acontecer ...  :D

Cod :

Private Sub getbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles getbtn.Click
        Dim MyValue As Integer = 0
        Dim i As Integer = 0
        Dim strMessage As String = " "
        Dim rop As Integer = 50
        Randomize()
        Do While i = 1

        Loop
        System.Threading.Thread.Sleep(50)
        MyValue = CInt(Int((50 * Rnd()) + 1))
        num1.Text = MyValue.ToString
        num1.Refresh()
        MyValue = CInt(Int((50 * Rnd()) + 1))
        num2.Text = MyValue.ToString
        num2.Refresh()
        MyValue = CInt(Int((50 * Rnd()) + 1))
        num3.Text = MyValue.ToString
        num3.Refresh()
        MyValue = CInt(Int((50 * Rnd()) + 1))
        num4.Text = MyValue.ToString
        num4.Refresh()
        MyValue = CInt(Int((50 * Rnd()) + 1))
        num5.Text = MyValue.ToString
        num5.Refresh()
        MyValue = CInt(Int((9 * Rnd()) + 1))
        est1.Text = MyValue.ToString
        est1.Refresh()
        MyValue = CInt(Int((9 * Rnd()) + 1))
        If i < rop Then
            est2.Text = MyValue.ToString
        ElseIf strMessage = " " Then
            est2.Text = MyValue.ToString
        Else
            est2.Text = ((Int(Val(Today().DayOfWeek)) _
              + strMessage.Length) Mod 10).ToString
        End If
        est2.Refresh()
    End Sub
    'Fechar aplicacao
    Private Sub resetbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles resetbtn.Click
        Me.shutdown()
    End Sub

    Private Sub shutdown()
        If Me.Visible Then
            Me.Visible = False
        End If
        Application.Exit()
    End Sub

End Class

Obrigado pela ajuda que possam dar

EDIT: Adicionado Geshi e alterado o titulo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.