Problems upgarding a program I made from VB.net 2003 to Vb.net 2005 express

I made a program a while back in vb.net, A fraction calculator, a long the way the form file for this project was lost when I had problems with a hard drive. I still had all the code so I decided to copy and paste the code into a new vb.net 2005 express project.  I rerembered what the old form looked like, so I recreated it from scratch and renamed all the controls to match the code. Every thing should have worked, so I thought.  When I try to run (bulild the program I get error messages saying variables  are not declared.  I copied all of the variables and placed them in the declarations.  example (Public intNum1 As Integer) I then move them  the calculate button click event and changed them from Public to Dim as .  Well this seemed to work as far as not saying they are not declared.    I created several Sub Procedures to do things like simplifing fractions, finding GCF ect.  when you press the calculate button it call these procedures get an anwser.  Now it is saying  GFC () name is not declare, that is the procedure to fing the Greatest common factor and all the procedures are reconizied(they say they  are not declared)

 Public Function GCF(ByVal int1 As Single, ByVal int2 As Single) As Single
            'Finds the greatest common factor of two integers
            Dim r As Single
            Dim x As Single
            If int1 < 0 Then int1 = System.Math.Abs(int1)
            If int2 < 0 Then int2 = System.Math.Abs(int2)
            If int1 = int2 Then GCF = int1 : Exit Function
            If int1 < int2 Then
                x = int2
                int2 = int1
                int1 = x
            End If
20:         r = int1 Mod int2
            If r = 0 Then GoTo 50
40:         int1 = int2 : int2 = r : GoTo 20
50:         GCF = int2
        End Function

I just wanted to show you what a sample of the code looked like, the others are procedures.....

these one will simplify Fracton 1

Public Sub SimpFraction1()
            'simplify fraction 1
            intNum1 = CInt(txtNum1.Text)
            intDen1 = CInt(txtDen1.Text)
            intMix1 = CInt(txtMix1.Text)
            intTemp4 = GCF(intNum1, intDen1)
            intNum1 = intNum1 / intTemp4
            intDen1 = intDen1 / intTemp4
            txtNum1.Text = intNum1
            txtDen1.Text = intDen1
        End Sub

All these work find in VB.net 2003 It appears the coding is the same for 2003 and 2005

How come I am getting these messages??????
ucla12Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Brian CroweDatabase AdministratorCommented:
none of the variables in SimpFraction1 are declared.

Public Sub SimpFraction1()
            'simplify fraction 1

dim intNum1, intDen1, intMix1, intTemp4 as integer

            intNum1 = CInt(txtNum1.Text)
            intDen1 = CInt(txtDen1.Text)
            intMix1 = CInt(txtMix1.Text)
            intTemp4 = GCF(intNum1, intDen1)
            intNum1 = intNum1 / intTemp4
            intDen1 = intDen1 / intTemp4
            txtNum1.Text = intNum1
            txtDen1.Text = intDen1
        End Sub
amyhxuCommented:
I'm not sure if the following function will make the error message away. But your old code is obviously not written in the .NET way. It could be those line numbers and GOTOs that's causing the problem. I've modified it to make it look a little better:

Public Function GCF(ByVal int1 As Single, ByVal int2 As Single) As Single
            'Finds the greatest common factor of two integers
            Dim r As Single
            Dim x As Single
            If int1 < 0 Then int1 = System.Math.Abs(int1)
            If int2 < 0 Then int2 = System.Math.Abs(int2)
            If int1 = int2 Then Return int1            
            If int1 < int2 Then
                x = int2
                int2 = int1
                int1 = x
            End If
            r = int1 Mod int2
            Do While r > 0
                int1 = int2
                int2 = r
                r = int1 Mod int2
            Loop
            Return int2
End Function

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
oleggoldCommented:
This seems exactly the answer to Your question:
http://www.codeproject.com/vb/net/
oleggoldCommented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.