The Random generator works fine. What I have a problem with is adding the rows and columns.
Array
0,0 0,1 0,2 = row total
1,0 1,1 1,2 = row total
2,0 2,1 2,2 = row total
= = =
col total coltotal col total
also add 0,0 1,1 2,2 - Private Sub BtnFillArray_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFillArray.Click
-
-
Dim Row As Integer
-
Dim Col As Integer
-
Dim Number As Integer
-
-
Number = RandomNumber.Next(RandomNumberLimit)
-
For Row = 0 To 2
-
For Col = 0 To 2
-
TwoDim(Row, Col) = Number
-
-
Number += 1
-
Next Col
-
Next Row
-
-
Lbl3x3ArrCell00.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell01.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell02.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell10.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell11.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell12.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell20.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell21.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
Lbl3x3ArrCell22.Text = CStr(RandomNumber.Next(RandomNumberLimit))
-
LblGBRowR1r0.Text = "" (holds results of 0,0 0,1 0,2)
-
LblGBRowR1r1.Text = "" (holds results of 1,0 1,1 1,2)
-
LblGBRowR1r2.Text = "" (holds results of 2,0 2,1 2,2)
-
-
LblGBColC1c0.Text = "" (holds results of 0,0 1,0 2,0)
-
LblGBColC1c1.Text = "" (holds results of 0,1 1,1 2,1)
-
LblGBColC1c2.Text = "" (holds results of 0,2 2,1 2,2)
-
-
LblGBDiaL.Text = "" (holds results of 0,0 1,1 2,2)
-
LblGBDiaR.Text = "" (holds results of 02 1,1 2,0)
-
End Sub
-
-
Tried this but results were faulty
-
Private Sub BtnCF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnCF.Click
-
'LblGBRowR1r0.Text = Convert.ToString(CInt(((TwoDim(0, 2) + TwoDim(0, 1) + TwoDim(0, 0)))))
-
'LblGBRowR1r1.Text = Convert.ToString(CInt(((TwoDim(1, 0) + TwoDim(1, 1) + TwoDim(1, 2)))))
-
'LblGBRowR1r2.Text = Convert.ToString(CInt(((TwoDim(2, 0) + TwoDim(2, 1) + TwoDim(2, 2)))))
-
'LblGBColC1c0.Text = Convert.ToString(CInt(((TwoDim(0, 0) + TwoDim(1, 0) + TwoDim(2, 0)))))
-
'LblGBColC1c1.Text = Convert.ToString(CInt(((TwoDim(0, 1) + TwoDim(1, 1) + TwoDim(2, 1)))))
-
'LblGBColC1c2.Text = Convert.ToString(CInt(((TwoDim(0, 2) + TwoDim(1, 2) + TwoDim(2, 2)))))
-
'LblGBDiaL.Text = Convert.ToString(CInt(((TwoDim(0, 0) + TwoDim(1, 1) + TwoDim(2, 2)))))
-
'LblGBDiaR.Text = Convert.ToString(CInt(((TwoDim(0, 2) + TwoDim(1, 1) + TwoDim(2, 0)))))
-
'End Sub
Just need a simple method to add Thanks
0 1179 Sign in to post your reply or Sign up for a free account.
Similar topics
by: J055 |
last post by:
Hi
I've been looking into different ways of formatting columns/rows in the
GridView control. I realize now, I think, that once the datasource is bound
to the control the original column type...
|
by: pinkyrose |
last post by:
Hi there,
i need some help in accessing a the ith row in a NxM array in vba. More specifically i have an NxM array called prices and i want to find the average of each row ,as well as the mean...
|
by: yoav.sagi |
last post by:
hi,
i am Inheriting from TableLayoutPane with a designer that inherits
from ParentControlDesigner
..i would like to allow the user to resize the columns and rows
..All rows and columns SizeType =...
|
by: selvamariappan |
last post by:
Hi all ,
how to display various color for rows in datagrid in vb.net 2005,
Not a Alternate colors,
Thanks and regards
selvamariappan.c
|
by: aashishn86 |
last post by:
i am using this function to add rows dynamically
function addRow()
{
var tbl = document.getElementById('applications');
var lastRow = tbl.rows.length;
// if there's no header row in...
|
by: viki1967 |
last post by:
Hi all.
I need your help.
I realize this script and I do not know where to begin:
1) A simple grid rows / columns.
2) The first column contain an input type = "checkbox"
3) When select...
|
by: ronakinuk |
last post by:
how can i unhide rows/columns in excel 2007
|
by: frj1001 |
last post by:
Hi
i am new to c sharp. i am building a simple calculator with a text box and few buttons. i need to store values entered into the text box from string to char array so that i can check for the '+'...
|
by: nawedita |
last post by:
Hi everyone
how i add and delete rows,and columns(textbox,dropdown) dynamically onclick button and store data in database with insert,update,delete record.that support all browsers.Because i am...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |