none
Visual Basic Health Club RRS feed

Answers

  • I did it. Here's the code for loading the ComboBox's and setting the TextBox to read only. I can't show you the code for how it works. However ComboBox's have selected index changed events. And I used both of those to verify the opposing ComboBox was not at selected index -1 meaning nothing was selected before using the code to do the math.

        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
    
            ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
            ComboBox1.Items.Add("Adult $100")
            ComboBox1.Items.Add("Senior $75")
    
            ComboBox2.DropDownStyle = ComboBoxStyle.DropDownList
            ComboBox2.Items.Add("Gold $300")
            ComboBox2.Items.Add("Silver $250")
            ComboBox2.Items.Add("Bronze $150")
    
            TextBox1.ReadOnly = True
            TextBox1.BackColor = Color.White
        End Sub


    La vida loca

    • Marked as answer by FtpManic Thursday, April 19, 2018 12:38 AM
    Wednesday, April 18, 2018 7:22 PM

All replies

  • Did your instructor give you work to perform without providing instruction to the level necessary to perform the work? Why don't you ask your instructor for assistance?

    It looks like simple math to me.


    La vida loca

    Wednesday, April 18, 2018 6:41 PM
  • My instructor is the worst and doesn't explain things very well at all, that's why i struggle in class and barely keep up with him since he talks so fast.

    Well even then you have a book and other students to enlist help from. Without studying and practicing then levels necessary will never be reached poor instructor or no. In my state over 1/3rd don't graduate high school and probably blame the instructors while the other 2/3rds probably don't blame anybody.

    Use a ComboBox so the user can select adult or senior. You can use another one to select Gold, Silver or Bronze membership. Then add the costs for the different selections. Simple.


    La vida loca

    Wednesday, April 18, 2018 6:48 PM
  • I did it. Here's the code for loading the ComboBox's and setting the TextBox to read only. I can't show you the code for how it works. However ComboBox's have selected index changed events. And I used both of those to verify the opposing ComboBox was not at selected index -1 meaning nothing was selected before using the code to do the math.

        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
    
            ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
            ComboBox1.Items.Add("Adult $100")
            ComboBox1.Items.Add("Senior $75")
    
            ComboBox2.DropDownStyle = ComboBoxStyle.DropDownList
            ComboBox2.Items.Add("Gold $300")
            ComboBox2.Items.Add("Silver $250")
            ComboBox2.Items.Add("Bronze $150")
    
            TextBox1.ReadOnly = True
            TextBox1.BackColor = Color.White
        End Sub


    La vida loca

    • Marked as answer by FtpManic Thursday, April 19, 2018 12:38 AM
    Wednesday, April 18, 2018 7:22 PM
  • Thanks for the help

     Why did you remove your whole question?  That makes this thread useless for anyone to understand what the answers are about when they see this thread in the future.  Please don't do that in the future.  Also,  please remember to mark the post or posts that answered your question,  as the answer(s).  Thanks.

    If you say it can`t be done then i`ll try it

    Wednesday, April 18, 2018 11:30 PM
  • Why did you remove your whole question?

    OP realized that their instructor can search by text. Quoting relevant parts of the original question (or providing a link to the original text) helps to discourage this sort of editing, and also helps to keep the thread meaningful when it does occur.

    Wednesday, April 18, 2018 11:51 PM
  • Thanks for the help


     Why did you remove your whole question?  That makes this thread useless for anyone to understand what the answers are about when they see this thread in the future.  Please don't do that in the future.  Also,  please remember to mark the post or posts that answered your question,  as the answer(s).  Thanks.

    If you say it can`t be done then i`ll try it


    I thought maybe he or she got mad or something. Anyhow he or she wanted to write a program based on instructions from a teacher where the user would select a membership age (Adult or Senior) and membership type (Gold, Silver or Bronze) with appropriate values and when the user selected both it would add the values together for a result.

    La vida loca

    Wednesday, April 18, 2018 11:57 PM
  • Why did you remove your whole question?

    OP realized that their instructor can search by text. Quoting relevant parts of the original question (or providing a link to the original text) helps to discourage this sort of editing, and also helps to keep the thread meaningful when it does occur.


    Lets hope one can spell Select at least :)  (and not work for the government).

    The questions lately have been absurdly or is it me?

    Thursday, April 19, 2018 12:02 AM
  • The questions lately have been absurdly or is it me?

     Nope,  it must just be you.  haha!!!

     I think you have what is called the 'Smart Effect'.   The smarter you get,  the dumber everyone else seems to be.   *** JUST JOKING ***


    If you say it can`t be done then i`ll try it

    Thursday, April 19, 2018 12:15 AM
  • Lets hope one can spell Select at least :)  (and not work for the government).

    The questions lately have been absurdly or is it me?

    But working for the Government is awesome because it is so inefficient you can get money for nothing and your checks for free.

    If the Government could run its agencies as close to a business model as possible then multitudes would be getting fired and there would be alot of jobs available due to actually requiring peeps to work and perform for a living.


    La vida loca

    Thursday, April 19, 2018 1:02 AM