I do not understand how this windows aplication is done.??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KF4fun
    New Member
    • Jul 2008
    • 1

    I do not understand how this windows aplication is done.??

    Recently i am being given a windows aplication which was made using VB.net . I was asked to remake the windows aplication but i found it quite hard to do so because i am new to VB.net . The codes were strangers to me .


    heres the aplication so can someone please explain to me how this aplication can be made . Thanks a bunch if u could do it .


    THE DOWNLOAD:DOwnload


    The CODES ARE AS FOLLOWS ..



    [code=vbnet]
    Public Class Form1
    dim timecounter as integer

    Private Sub Button5_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button5.Click

    MsgBox("you are given 15 sec to rember")
    Timer1.Enabled = True
    Dim r As New Random
    Label2.Text = r.Next(1, 100)
    Label3.Text = r.Next(1, 100)
    Label4.Text = r.Next(1, 100)
    Label5.Text = r.Next(1, 100)
    Label6.Text = r.Next(1, 100)

    Button1.Enabled = False
    Button2.Enabled = False
    Button3.Enabled = False
    Button4.Enabled = False
    Button5.Enabled = False
    Button6.Enabled = False



    End Sub

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
    Label7.Text = Label2.Text
    Label2.Text = Label3.Text
    Label3.Text = Label7.Text
    Label7.BackColo r = Label2.BackColo r
    Label2.BackColo r = Label3.BackColo r
    Label3.BackColo r = Label7.BackColo r
    Label7.ForeColo r = Label2.ForeColo r
    Label2.ForeColo r = Label3.ForeColo r
    Label3.ForeColo r = Label7.ForeColo r
    End Sub

    Private Sub Button4_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button4.Click
    Label7.Text = Label3.Text
    Label3.Text = Label4.Text
    Label4.Text = Label7.Text
    Label7.BackColo r = Label3.BackColo r
    Label3.BackColo r = Label4.BackColo r
    Label4.BackColo r = Label7.BackColo r
    Label7.ForeColo r = Label3.ForeColo r
    Label3.ForeColo r = Label4.ForeColo r
    Label4.ForeColo r = Label7.ForeColo r
    End Sub

    Private Sub Button3_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button3.Click
    Label7.Text = Label4.Text
    Label4.Text = Label5.Text
    Label5.Text = Label7.Text
    Label7.BackColo r = Label4.BackColo r
    Label4.BackColo r = Label5.BackColo r
    Label5.BackColo r = Label7.BackColo r
    Label7.ForeColo r = Label4.ForeColo r
    Label4.ForeColo r = Label5.ForeColo r
    Label5.ForeColo r = Label7.ForeColo r
    End Sub

    Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button2.Click
    Label7.Text = Label5.Text
    Label5.Text = Label6.Text
    Label6.Text = Label7.Text
    Label7.BackColo r = Label5.BackColo r
    Label5.BackColo r = Label6.BackColo r
    Label6.BackColo r = Label7.BackColo r
    Label7.ForeColo r = Label5.ForeColo r
    Label5.ForeColo r = Label6.ForeColo r
    Label6.ForeColo r = Label7.ForeColo r
    End Sub

    Private Sub Timer1_Tick(ByV al sender As System.Object, ByVal e As System.EventArg s) Handles Timer1.Tick
    timecounter = timecounter - 1
    Label8.Text = "time remaining :" & timecounter
    If timecounter = 0 Then
    Button1.Enabled = True
    Button2.Enabled = True
    Button3.Enabled = True
    Button4.Enabled = True

    Label2.ForeColo r = Label2.BackColo r
    Label3.ForeColo r = Label3.BackColo r
    Label4.ForeColo r = Label4.BackColo r
    Label5.ForeColo r = Label5.BackColo r
    Label6.ForeColo r = Label6.BackColo r
    Timer1.Enabled = False
    End If
    End Sub

    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
    timecounter = 15
    Button1.Enabled = False
    Button2.Enabled = False
    Button3.Enabled = False
    Button4.Enabled = False

    End Sub
    End Class
    [/code]
    Last edited by Frinavale; Jul 1 '08, 02:27 PM. Reason: added [code] tags
  • asedt
    New Member
    • Jun 2008
    • 130

    #2
    I'm quite new to .net, but can maybe give you some help, I have VS 2005 so if you work with .net or 2008 it may be differences, but i don't gonna to download that stuff :).

    First start visual studio in visual basic mode.

    Then chose to create new project of type Visual basic - Windows - Window Aplication.

    Then you bild the form, with all objets mentioned in the code, if you know the how the user interface looks like then it's easy to add the objets like buttoms, labels and menues. Then from the code i se that you Need a Timer Component that you add from the Toolbox like the buttons and stuff to.

    Then if you have the UI and Timmer rightclik and chose view code, then form.vb is open and there you paste your code or whrite your own.

    Comment

    Working...