Main Menu

News:

Please be aware of the Forum Rules of Conduct.

Visual Basic Anyone?

Started by DoctorHarte, March 23, 2011, 03:59:52 AM

Previous topic - Next topic

DoctorHarte

I know there are quite a few programmers who play BM (obviously) and was wondering if any of you would help me?
Public Class Form1

     Private Sub BtnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCompute.Click
        Dim velocity As Double
        Dim sec1 As Double
        Dim sec2 As Double
        Dim sec3 As Double

        sec1 = (-16 * 1) + (velocity * 1) + 5
        sec2 = (-16 * 4) + (velocity * 2) + 10
        sec3 = (-16 * 9) + (velocity * 3) + 15
    End Sub

    Private Sub sec1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sec1.TextChanged
        sec1.Text = "  "

    End Sub

    Private Sub sec2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sec2.TextChanged
        sec2.Text = "  "
    End Sub

    Private Sub sec3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sec3.TextChanged
        sec3.Text = "  "
    End Sub

End Class


The text boxes must appear to be blank at the start. The thing I cannot fathom how to do although it's probably most easy, is how to code the program to display the results of the formula in the text box after the button has been clicked.

I'm having a real hard time right now and have been researching how to do this for hours!
New Harte Family: Eros (Vix Tiramora, EC), Nyx (Fronen, BT), Chance (Avernus, DW), Scopuli (Gothica, Colonies)

Old Harte Family: Hyperion (Aurvandil, DW), William (IVF, BT), Katrina (Fronen, BT), Callandor II (Ohnar West, FE)

De-Legro

First problem, using visual basic. That said do you have the event handler for the button set up so that the calculation is performed when you click the button?
Previously of the De-Legro Family
Now of representation unknown.

DoctorHarte

It's all good, I figured it out. Had to set the Text Property to this and that. I was told too late that I should have done C++ instead of VB
New Harte Family: Eros (Vix Tiramora, EC), Nyx (Fronen, BT), Chance (Avernus, DW), Scopuli (Gothica, Colonies)

Old Harte Family: Hyperion (Aurvandil, DW), William (IVF, BT), Katrina (Fronen, BT), Callandor II (Ohnar West, FE)

De-Legro

VB is great for doing simple things with forms though. C++ needs a little more work when doing GUI stuff, depending on what GUI framework you choose.
Previously of the De-Legro Family
Now of representation unknown.

^ban^

Quote from: De-Legro on March 23, 2011, 10:19:09 AM
VB is great for doing simple things with forms though.


Or you could just use Java and avoid the abomination that is VB.
Born in Day they knew the Light; Rulers, prophets, servants, and warriors.
Life in Night that they walk; Gods, heretics, thieves, and murderers.
The Stefanovics live.

DoctorHarte

Quote from: ^ban^ on April 01, 2011, 10:24:00 AM

Or you could just use Java and avoid the abomination that is VB.

I wish I could, but it's a class I am required to go through.. for some odd reason. Plus I can use it as a math credit  8)
New Harte Family: Eros (Vix Tiramora, EC), Nyx (Fronen, BT), Chance (Avernus, DW), Scopuli (Gothica, Colonies)

Old Harte Family: Hyperion (Aurvandil, DW), William (IVF, BT), Katrina (Fronen, BT), Callandor II (Ohnar West, FE)

Madmonk77

Quote from: ^ban^ on April 01, 2011, 10:24:00 AM

Or you could just use Java and avoid the abomination that is VB.

Ha, another java mate!
Nico.-

"What else can happen when an unstoppable force collides with an immovable object?" -- Used to be the player of Vats family. Now I'm the player of Vlad family.

Foundation

Python here. 8)

Also C++/Java/PHP.
The above is accurate 25% of the time, truthful 50% of the time, and facetious 100% of the time.

De-Legro

hehe

I've used lots of different languages in my time, but I find the one most people have never heard of would be Fortran.
Previously of the De-Legro Family
Now of representation unknown.

Darksun

Quote from: De-Legro on April 13, 2011, 01:44:11 PM
hehe

I've used lots of different languages in my time, but I find the one most people have never heard of would be Fortran.

There is still a mind-boggling amount of FORTRAN and COBOL in the world. All those new college grads and their fancy object oriented languages are usually astounded by this discovery. Financial services companies are the worst.

De-Legro

Fortran is still one of the systems to bench mark Super Computers. For complex calculations I still haven't seen a language that approaches Fortran. I guess the reason most people I talk to are unaware of it is because its not really used as a general purpose language. You are hardly going to see some little windows GUI application written in Fortran.
Previously of the De-Legro Family
Now of representation unknown.

jaune

GW-Basic ftw!

Then it was ruined and quick basic came and line numbers were not needed anymore  :'(
~Violence is always an option!~

Richard Leonecoeur

I use Java primarily, myself. It's a nice language, but it has some problems still and I personally think it's about due for a big update which could hopefully make it a bit more efficient.

I want to learn C sharp next, but I've also been looking in to UnityScript.