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 7413477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:02+00:00 2026-05-29T06:55:02+00:00

Just wondering if anyone can help me with this slight issue. I’m writing a

  • 0

Just wondering if anyone can help me with this slight issue. I’m writing a simple multiplications table using a list box to display the times tables when a user clicks a button. However, the numerous loops look quite messy and I would like to place them in a method/function that will allow the manipulation of integer values in the button click events so that the correct values can be inserted i.e 2x times would have a valueOne = 2 To valueTwo = 24 and Step = 2 (referencing the 2 times table) etc This is what I currently have just now (based on 7 times table example) but I feel I have not written my sub correctly. Any pointers and advice would be much appreciated and helpful. Thanks.

Note: Variables are declared globally

Private Sub newLoop()

        For xTablesAnswer As Integer = valueOne To valueTwo Step valueThree
            xTableNumOrder = xTableNumOrder + 1
            lstData.Items.Add("7 Times " & xTableNumOrder.ToString & " = " & xTablesAnswer.ToString)
        Next

    End Sub


    Private Sub bnt7X_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnt7X.Click

        ClearList()

        valueOne = 7
        valueTwo = 84
        valueThree = 7

        newLoop()

    End Sub
End Class
  • 1 1 Answer
  • 2 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-05-29T06:55:03+00:00Added an answer on May 29, 2026 at 6:55 am

    I would do it like this:

    Public Sub ShowTable(value As Integer, lastMultiple As Integer)
    
    lstData.Items.Clear()
    
    For i As Integer = 1 to lastMultiple
        lstData.Items.Add(String.Format("{0} times {1} = {2}", value, i, value * i))                        
    Next
    
    End Sub
    

    Then for 7 times table, you would call it like this:

    ShowTable(7, 12)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering if anyone can help with this. I have a table with some fixed
Wondering if anyone can help me with this slight problem i'm having. I am
Just wondering if anyone can optimize this usortMonths() function to be better? Basically I
I was wondering if anyone can help me on this cause its driving me
I was wondering if anyone can help me. I'm using Adobe Acrobat Pro 9
Just wondering if anyone can help me in andriod app development. I'm new to
Just wondering if anyone can help me with a little programming math i'm having
wondering if anyone can help. This works, but I was wondering how it would
Just wondering if anyone could help me with this. I'm new to actionscript, and
Wondering if anyone can help me with this annoying but trivial (in terms of

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.