locked
form application RRS feed

  • Question

  • Hello,

     

    I am a new user.  Never worked with VB before.  I wanne make a windows form application.  Its a currency converter that can convert EUROS to belgium franks,german marks and the coins off Nederland.  it has to be possibel to round the result to zero decimal. I already made the design with the radiobuttons and labels.  But I dont know how to make it work.  Its also for a assignment.  I am totaly lost.

     

    Can someone help me?

     

    Wednesday, February 23, 2011 8:30 AM

Answers

  • Hi,

    first of all I want to direct you to the Visual Basic Express forum which can be a better forum for this question.
    http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/threads

    I cannot see the pictures you inserted so I have no idea, how far you are.

    Common practices can be:

    Add a button and rename it to whatever you want (e.g. Calculate). When you double click the button, Visual Studio creates a function which is called when the user presses the button.

    The first step, that is important, can be the check, if the user inserted something valid. (This normaly involes a check, if the Text property of the textbox is filles (String.IsNullOrEmpty(myTextbox.Text) and when you expect a number, you should try to parse it. So it could be a call like Double.TryParse(...).

    Then you have the inserted value and you can do the calculation. So if you have radio buttons, you could use a switch statement to find out which one is selected and set a double value called factor or so.

    At the end, you coudl set the Text property of a label to the result. Something like resultLabel.Text = amount * factor.

    Another possibility could be to do all the calculation whenever the inputbox is changed or the radiobutton is changed. That are some other events and you can look at the properties of these elements. In the property window you also see the possible events and you can choose a an existing method or even let visual studio create a new one.

    I hope I was able to point you to some interesting topics so you can read on the msdn library and find all you want. (msdn library also has some nice example code that might help).

    Feel free to ask in the VB forum and if you provide more information, I am sure that people in there will help much further.

    With kind regards,

    Konrad

    • Marked as answer by Rubel Khan Friday, March 4, 2011 3:30 PM
    Wednesday, February 23, 2011 8:59 AM
    Answerer

All replies

  • Hi,

    first of all I want to direct you to the Visual Basic Express forum which can be a better forum for this question.
    http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvb/threads

    I cannot see the pictures you inserted so I have no idea, how far you are.

    Common practices can be:

    Add a button and rename it to whatever you want (e.g. Calculate). When you double click the button, Visual Studio creates a function which is called when the user presses the button.

    The first step, that is important, can be the check, if the user inserted something valid. (This normaly involes a check, if the Text property of the textbox is filles (String.IsNullOrEmpty(myTextbox.Text) and when you expect a number, you should try to parse it. So it could be a call like Double.TryParse(...).

    Then you have the inserted value and you can do the calculation. So if you have radio buttons, you could use a switch statement to find out which one is selected and set a double value called factor or so.

    At the end, you coudl set the Text property of a label to the result. Something like resultLabel.Text = amount * factor.

    Another possibility could be to do all the calculation whenever the inputbox is changed or the radiobutton is changed. That are some other events and you can look at the properties of these elements. In the property window you also see the possible events and you can choose a an existing method or even let visual studio create a new one.

    I hope I was able to point you to some interesting topics so you can read on the msdn library and find all you want. (msdn library also has some nice example code that might help).

    Feel free to ask in the VB forum and if you provide more information, I am sure that people in there will help much further.

    With kind regards,

    Konrad

    • Marked as answer by Rubel Khan Friday, March 4, 2011 3:30 PM
    Wednesday, February 23, 2011 8:59 AM
    Answerer
  • hello,

     

    I am not at home.  So I dont have vb to show you what I have.but its 3 radiobuttons.1 button to convert.and 2 labels.1 next were you enter the number and 1 as result. and 1 button to round it to zero decimals.  I dont have any expirence with vb at all.its the first time.

     

    best regards

     

    Bart

    Wednesday, February 23, 2011 11:33 AM