Re: A bit of help needed to make a simple program
Not knowing your level of knowledge in regards to Visual Studio I'll try and explain it as simply as possible..... I'm not trying to insult you, I just don't want to assume you know something so bear with me.
Start Visual Studio
File -> New Project
In the next screen enter your project's name in the text box on the bottom, select Windows Application and click next.
From the toolbox drag and drop 2 text boxes and a combo-box into the GUI
Click on the combo-box and then in the properties window(usually on the bottom right) enter a "name" property for the combo-box (cmbChoices). Repeat with each text box (txtStart, txtFinish). Set the Read Only property of txtFinish to true.
Select the combo-box again and in the properties window enter the values you want in the drop down list in the "Items" property (should say "Collection") next to it.
Double click on the combo-box, this will take you to the code behind screen and create an event handler for the combo-box.
Event Handler:
Private Sub cmbChoice_SelectedIndexChanged(ByVal sender As System.Object, ByVal e as System.EventArgs) Handles cmbChoice.SelectedIndexChanged
insert your code here
End Sub
You can use if....then statements, case statements.... what ever your heart desires here. For example if I was doing temperature conversion using VB.NET
Dim choice as String = cmbChoice.SelectedItem.ToString()
Dim temp as double = CType(txtStart.text, double)
Dim result as double
if choice = "Celcius" then
result = insert f to c equation here
txtFinish.text = result
else
result = insert c to f equation here
txtFinish.text = result
end if
does that help at all?
__________________
Gaming
MSI Z68 G3 | 2500k | CNPS9900MAX-B | 8GB G.Skill | EVGA GTX570 2560MB |ThermalTake 850w | X-Fi Titanium | Antec 900 | Asus PA248Q | Lycosa | Death Adder | Win7 Pro 64
Dev/Backup
Asus P5QL Pro | Q9400 | H50 | 8GB G.skill | GTX260 216 | Ubuntu 11.10
Laptop
17" Inspiron | i5 | 4GB DDR3 | 500GB HDD | Win7 Pro 64
|