Welcome to Dream.In.Code
Become a VB Expert!

Join 149,486 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,333 people online right now. Registration is fast and FREE... Join Now!




A multiplication table different from previous

 
Reply to this topicStart new topic

A multiplication table different from previous, Having issues with the display click procedure not multiplying

Jeremiah1974
3 May, 2007 - 10:33 PM
Post #1

New D.I.C Head
*

Joined: 3 May, 2007
Posts: 1


My Contributions
I currently am stuck on this multiplication table concerning the click event procedure for my display button. I have declared all the variables and written a For...Next statement however the display button is not giving the results.
CODE
Option Explicit On
Option Strict On

Public Class MainForm

    Private Sub btnClear_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClear.Click
        ' clears the screen for the next calculation

        ' clear the text boxes and set the focus
        txtNumber1.Clear()
        txtNumber2.Clear()
        txtNumber3.Clear()
        txtNumber4.Clear()
        txtNumber5.Clear()
        txtNumber6.Clear()
        txtNumber7.Clear()
        txtNumber8.Clear()
        txtNumber9.Clear()
        txtResult1.Clear()
        txtResult2.Clear()
        txtResult3.Clear()
        txtResult4.Clear()
        txtResult5.Clear()
        txtResult6.Clear()
        txtResult7.Clear()
        txtResult8.Clear()
        txtResult9.Clear()
        txtNumber1.Focus()
    End Sub

    Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub

    Private Sub btnDisplay_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
        ' displays the results of the multiplication table

        Dim txtNumber1 As Integer
        Dim txtNumber2 As Integer
        Dim txtNumber3 As Integer
        Dim txtNumber4 As Integer
        Dim txtNumber5 As Integer
        Dim txtNumber6 As Integer
        Dim txtNumber7 As Integer
        Dim txtNumber8 As Integer
        Dim txtNumber9 As Integer
        Dim txtResult1 As Integer
        Dim txtResult2 As Integer
        Dim txtResult3 As Integer
        Dim txtResult4 As Integer
        Dim txtResult5 As Integer
        Dim txtResult6 As Integer
        Dim txtResult7 As Integer
        Dim txtResult8 As Integer
        Dim txtResult9 As Integer
        Dim lblX1 As Integer
        Dim lblX2 As Integer
        Dim lblX3 As Integer
        Dim lblX4 As Integer
        Dim lblX5 As Integer
        Dim lblX6 As Integer
        Dim lblX7 As Integer
        Dim lblX8 As Integer
        Dim lblX9 As Integer

        For txt As Integer = 1 To 9 Step 1
            txtNumber1 = txtNumber1 * lblX1
            txtNumber2 = txtNumber2 * lblX2
            txtNumber3 = txtNumber3 * lblX3
            txtNumber4 = txtNumber4 * lblX4
            txtNumber5 = txtNumber5 * lblX5
            txtNumber6 = txtNumber6 * lblX6
            txtNumber7 = txtNumber7 * lblX7
            txtNumber8 = txtNumber8 * lblX8
            txtNumber9 = txtNumber9 * lblX9
        Next txt



Attached File(s)
Attached File  Multiplication_Table_Solution__2_.zip ( 60.54k ) Number of downloads: 46
User is offlineProfile CardPM
+Quote Post

melonchollie540
RE: A Multiplication Table Different From Previous
5 May, 2007 - 06:30 AM
Post #2

New D.I.C Head
*

Joined: 6 Feb, 2007
Posts: 29


My Contributions
You didn't declare values for all of your txtNumber Variables, as well as for the lblX variables.


Actually, are these even supposed to be variables? I say this because they are named like labels and text boxes. In that case, the code we need to be revamped even more.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 04:56PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month