none
Windows Form Application RRS feed

  • Question

  • How to display a label and radio buttons when a user chooses 1 of  2 options from a combo box?
    Friday, May 12, 2017 9:51 PM

Answers

  • Nope, I was doing a online course on VB.Net and my lecturer sent me and a few other people these assignments to practice on. 

    It seems fairly straightforward; it's a practice in logic flow.

    You'll want to start with an event: Knowing when (and what) the user has selected with the combobox. For that, you'll probably want to use the .SelectedIndexChanged event.

    With that, work through the rest of the spec.

    Does that help?


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    • Marked as answer by dax911 Friday, May 12, 2017 10:30 PM
    Friday, May 12, 2017 10:22 PM

All replies

  • How to display a label and radio buttons when a user chooses 1 of  2 options from a combo box?

    You need to explain more about what you have and what you're wanting, but on the surface it sounds like it's a matter of how you form the logic in your program.

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Friday, May 12, 2017 9:56 PM
  • I would provide screenshots of my form layout but every time I try to add a picture to the message box, it says "Body text cannot contain images or links until we are able to verify your account." , but back to the matter at hand, I have very little experience in coding. I was given an assignment with these specifications: Make a program which displays an appropriate name for a person, using a combination of nested ifs and compound conditions. Ask the user for a gender, first name, last name and age. If the person is female and 20 or over, ask if she is married. If so, display "Mrs." in front of her name, if not, display "Ms." in front of her name. If the female is under 20, display her first and last name. If the person is a male and 20 or over, display "Mr." in front of his name. Otherwise, display his first and last name. Note that asking a person if they are married should only be done if they are female and 20 or older.

    Is this a school assignment then?

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Friday, May 12, 2017 10:09 PM
  • How to display a label and radio buttons when a user chooses 1 of  2 options from a combo box?


    You need to explain more about what you have and what you're wanting, but on the surface it sounds like it's a matter of how you form the logic in your program.

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    I would provide screenshots of my form layout but every time I try to add a picture to the message box, it says "Body text cannot contain images or links until we are able to verify your account." , but back to the matter at hand, I have very little experience in coding. I was given an assignment with these specifications: Make a program which displays an appropriate name for a person, using a combination of nested ifs and compound conditions. Ask the user for a gender, first name, last name and age. If the person is female and 20 or over, ask if she is married. If so, display "Mrs." in front of her name, if not, display "Ms." in front of her name. If the female is under 20, display her first and last name. If the person is a male and 20 or over, display "Mr." in front of his name. Otherwise, display his first and last name. Note that asking a person if they are married should only be done if they are female and 20 or older.
    Friday, May 12, 2017 10:09 PM
  • I would provide screenshots of my form layout but every time I try to add a picture to the message box, it says "Body text cannot contain images or links until we are able to verify your account." , but back to the matter at hand, I have very little experience in coding. I was given an assignment with these specifications: Make a program which displays an appropriate name for a person, using a combination of nested ifs and compound conditions. Ask the user for a gender, first name, last name and age. If the person is female and 20 or over, ask if she is married. If so, display "Mrs." in front of her name, if not, display "Ms." in front of her name. If the female is under 20, display her first and last name. If the person is a male and 20 or over, display "Mr." in front of his name. Otherwise, display his first and last name. Note that asking a person if they are married should only be done if they are female and 20 or older.


    Is this a school assignment then?

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Nope, I was doing a online course on VB.Net and my lecturer sent me and a few other people these assignments to practice on. 
    Friday, May 12, 2017 10:14 PM
  • Nope, I was doing a online course on VB.Net and my lecturer sent me and a few other people these assignments to practice on. 

    It seems fairly straightforward; it's a practice in logic flow.

    You'll want to start with an event: Knowing when (and what) the user has selected with the combobox. For that, you'll probably want to use the .SelectedIndexChanged event.

    With that, work through the rest of the spec.

    Does that help?


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    • Marked as answer by dax911 Friday, May 12, 2017 10:30 PM
    Friday, May 12, 2017 10:22 PM
  • Nope, I was doing a online course on VB.Net and my lecturer sent me and a few other people these assignments to practice on. 

    It seems fairly straightforward; it's a practice in logic flow.

    You'll want to start with an event: Knowing when (and what) the user has selected with the combobox. For that, you'll probably want to use the .SelectedIndexChanged event.

    With that, work through the rest of the spec.

    Does that help?


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    That's actually a good point, completely forgot about the events. Thank you Frank
    Friday, May 12, 2017 10:26 PM
  • That's actually a good point, completely forgot about the events. Thank you Frank
    You're welcome. :)

    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Friday, May 12, 2017 10:31 PM
  • Note that asking a person if they are married should only be done if they are female and 20 or older.

    Also note that in an event-driven environment you don't 'ask'.  You provide a facility to enter the information and check that the information entered was valid.   Or you don't provide that facility (or disable it) if it's not relevant.

    See here for verification (topmost thread):
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=reportabug

    Saturday, May 13, 2017 1:19 AM