2 Replies - 1218 Views - Last Post: 15 January 2009 - 10:33 AM Rate Topic: -----

#1 militarybrat  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-January 09

i need help with my final exam in vb 2008

Posted 14 January 2009 - 03:41 PM

i have to creaet a program...


i am stuck on how to do things....


i can either use group boxes or i can use different forms....



right now i am working with different forms because i thought it would be easier but this seems to be hard...

i can get the first form to work properly but i cant get it to switch from the other 6 forms...

like i would like the program to run and then when i hit on the menu bar to go to the next form i want it to switch......


i am suppose to use radio buttons

i am suppose to have an animation going...i have animation moving and stoping when i need it....
but i am suppose to have two different animations that move at two different speeds....and i am not sure on how to do that

Public Class form1
    Dim form As Form1


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Interval = 120
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Timer1.Start()

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Timer1.Stop()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.Close()

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static Dim i As Integer
        i += 1

        If i > 4 Then i = 1

        Select Case i
            Case 1 : PictureBox1.Image = My.Resources.frame_1
case2:      Case 2 : PictureBox1.Image = My.Resources.frame_2
            Case 3 : PictureBox1.Image = My.Resources.frame_3
            Case 4 : PictureBox1.Image = My.Resources.frame_4


        End Select

    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

    End Sub
End Class


that is wat i have for the animation.....

and i do not know wat a pickler is at all and i am suppose to use it....

i have to do loops and i have them down i have this for my code...

Public Class Form2
    Dim form As Form2



    Private Sub ForNextDefaultToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ForNextDefaultToolStripMenuItem.Click
        For I As Integer = 1 To 100
            TextBox1.Text &= I & ", "
        Next
        TextBox1.Text &= vbCrLf
        TextBox1.Text &= vbCrLf
    End Sub

    Private Sub ForNextStepToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ForNextStepToolStripMenuItem.Click
        Dim I, J As Integer
        Dim Letter As String
        For I = 65 To 122 Step 2
            Letter = Chr(I)
            TextBox1.Text &= Letter & ". "
            For J = 66 To 123 Step 2
                Letter = Chr(J)
                TextBox1.Text &= Letter & ", "

            Next
            TextBox1.Text &= vbCrLf
        Next
        TextBox1.Text &= vbCrLf
        TextBox1.Text &= vbCrLf
    End Sub

    Private Sub ForNextBackwardsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ForNextBackwardsToolStripMenuItem.Click
        For I As Integer = 20 To 1 Step -2
            TextBox1.Text &= I & vbCrLf
            For J As Integer = 1 To 5
                TextBox1.Text &= J & ","
            Next
            TextBox1.Text &= vbCrLf
        Next

    End Sub

    Private Sub SampleOneToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SampleOneToolStripMenuItem.Click
        Dim I, J, K As Integer
        I = InputBox("Enter A Starting Number")
        J = InputBox("Enter A Ending Number")
        K = InputBox(" Enter An Interval")
        For counter As Integer = I To J Step K
            TextBox1.Text &= counter & ", "

        Next
        TextBox1.Text &= vbCrLf

    End Sub
    Private Sub DoUntilLoopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DoUntilLoopToolStripMenuItem.Click
        Dim x As Integer = Val(TextBox2.Text)
        Do Until x <= 0
            MsgBox("x=" & x)
            x -= 22


        Loop
        MsgBox("done")
    End Sub

    Private Sub DoLoopUntilToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DoLoopUntilToolStripMenuItem.Click
        Dim x As Integer = Val(TextBox2.Text)
        Do Until x <= 0
            MsgBox("x=" & x)
            x -= 1


        Loop
        MsgBox("done")


    End Sub

    Private Sub Sample1ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sample1ToolStripMenuItem.Click
        Dim I As Integer = 0
        Dim Word As String = TextBox2.Text
        Dim Len As Integer = Word.Length - 1

        Do

            TextBox1.Text &= Word.Substring(I, 1) & vbCrLf
            I += 1


        Loop Until I > Len


    End Sub

    Private Sub Sample2ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sample2ToolStripMenuItem.Click

        Dim Word As String = TextBox2.Text
        Dim Len As Integer = Word.Length - 1
        Dim I As Integer = Word.Length

        Do
            TextBox1.Text &= Word.Substring(I, 1) & vbCrLf
            I -= 1


        Loop Until I > 0



    End Sub



    Private Sub DoWhileLoopToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DoWhileLoopToolStripMenuItem.Click
        Dim i As Integer = 0
        Do
            TextBox1.Text &= i & ", "
            i += 1
        Loop While i <= 10
        TextBox1.Text &= vbCrLf


    End Sub

    Private Sub DoLoopWhileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DoLoopWhileToolStripMenuItem.Click
        Dim i As Integer = 0
        Do While i <= 10
            TextBox1.Text &= i & ". "
            i += 1
        Loop
        TextBox1.Text &= vbCrLf


    End Sub

    Private Sub Sample1ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Sample1ToolStripMenuItem1.Click
        Dim word As String = " this is a test!)"
        Dim i As Integer
        Dim len As Integer

        len = word.Length
        TextBox1.Text &= "there are" & len & "letters." & vbCrLf

        Do
            TextBox1.Text &= word.Substring(i, 1) & vbCrLf
            i += 1
        Loop While i <= len - 1

    End Sub

    Private Sub SampleTwoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SampleTwoToolStripMenuItem.Click
        Dim word As String = " Now is the best day  of the rest of your life"
        Dim i As Integer
        Dim len As Integer = word.Length
        TextBox1.Text &= " There are" & len & "letters." & vbCrLf
        TextBox1.Text &= word
        i = len - 1
        Do While i >= 0 'why doesnt this work?
            TextBox1.Text &= word.Substring(i, 1)
            i -= 1
        Loop
    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub
End Class



but wat i dont know is how to get all the forms to work when i run my program

can anyone help me?? with some codes...


u can also try and explain it to me where i am just using groupboxes i just need to have it done by friday....

Mod Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

This post has been edited by PsychoCoder: 15 January 2009 - 10:32 AM


Is This A Good Question/Topic? 0
  • +

Replies To: i need help with my final exam in vb 2008

#2 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: i need help with my final exam in vb 2008

Posted 14 January 2009 - 03:43 PM

You actually did not mention what is your project going to do - you need to provide some more details on how the project is organized and what it is supposed to do.

Also, Dream.In.Code forum rules state that you should show some effort in solving your problem. Please, post the code you've been working so far. Post the code between code tags: :code:

Thank you!
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: i need help with my final exam in vb 2008

Posted 15 January 2009 - 10:33 AM

VB 2008 is VB.NET, moving this to the VB.NET forum :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1