Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:22:45+00:00 2026-06-12T23:22:45+00:00

Hi I am trying to make a program that has 6 checkboxes and when

  • 0

Hi I am trying to make a program that has 6 checkboxes and when one is checked a label displays the actors take in average, but if more than one is checked the label will only show the highest average of the checked boxes.

 Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

    SC = ((Val(425488741) + Val(555909803) + Val(868659354) + Val(966435555) + Val(720388023) + Val(617520987)) / 6)

    If CheckBox1.Checked = True Then

        Label3.Text = "Sean Connery $" & SC

        Exit Sub

    End If

End Sub



Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged

    GL = 513445231

    If CheckBox2.Checked = True Then

        Label3.Text = "George Lazenby $" & GL

        Exit Sub

    End If

End Sub



Private Sub CheckBox3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox3.CheckedChanged

    RM = ((Val(785677477) + (426826774) + (666367656)  + (624527272) + (481005579) + (405873493) + (316186616)) / 7)

    If CheckBox3.Checked = True Then

        Label3.Text = "Roger Moore $" & RM

        Exit Sub

    End If

End Sub



Private Sub CheckBox4_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox4.CheckedChanged

    TD = ((Val(362876056) + (271586451)) / 2)

    If CheckBox4.Checked = True Then

        Label3.Text = "Timothy Dalton $" & TD

        Exit Sub

    End If

End Sub



Private Sub CheckBox5_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox5.CheckedChanged

    PB = ((Val(499954330) + (465588535) + (504705882)  + (546490272)) / 4)

    If CheckBox5.Checked = True Then

        Label3.Text = "Pierce Brosnan $" & PB

        Exit Sub

    End If

End Sub



Private Sub CheckBox6_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox6.CheckedChanged

    DC = ((Val(640803677) + (586090727)) / 2)

    If CheckBox6.Checked = True Then

        Label3.Text = "Daniel Craig $" & DC

        Exit Sub

    End If

 End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:22:46+00:00Added an answer on June 12, 2026 at 11:22 pm

    In the future, when asking a question, please do not include all the unnecessary details. If understand your problem correctly, this is one possible simple solution:

    Dim incomes = New Integer() {100, 2000, 500}
    Dim names = New String() {"John", "Tim", "Allan"}
    
    Private Sub CheckedListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles CheckedListBox1.SelectedIndexChanged
        Dim maxIncome As Integer = 0
        Dim name As String = ""
    
        For i = 0 To incomes.Length - 1
            If CheckedListBox1.GetItemChecked(i) And incomes(i) > maxIncome Then
                maxIncome = incomes(i)
                name = names(i)
            End If
        Next
    
        Label1.Text = name & " $" & maxIncome
    End Sub
    

    For this code to work you need to create a CheckedListBox with 3 items in it’s collection. However, this approach might lead to a very bad code once there are many values. In that case you should use a database or at least a structure like:

    Structure People
        Dim name As String
        Dim income As Integer
        Dim checkBox As CheckBox
    End Structure
    

    Also the is no need to write Exit Sub anywhere in your code, it does nothing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a program in Visual C# that has my one created
im trying to make a simple program that has one BITMAP that is the
I'm trying to make a program that lets you input any one-step equation, and
I am trying to make a program that can take an .mp3 file from
A am trying to make a program that takes a signal from one class
I am trying to write a program that has twenty five buttons, when one
I'm trying to make a program that takes in one argument, a file, and
I am trying to make a program that has 2 views. The first view
Im trying to make a program that retrieves an endless amount of numbers that
I'm trying to make a program that, using pointers, detects lines in an image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.