Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

[RESOLVED] Printing matrix to textbox

$
0
0
How do I print a matrix (8 x 8) with data in each cell to a textbox so it will look like this:

Code:

+----+----+----+----+----+----+----+----+
 |    |    | BK | BR |    | BB |    | BR |
 +----+----+----+----+----+----+----+----+
 | BP | BP | BP |    | BP | BP | BP | BP |
 +----+----+----+----+----+----+----+----+
 |    |    | BN | BQ |    | BN |    |    |
 +----+----+----+----+----+----+----+----+
 |    | BB |    | BP |    |    | WB |    |
 +----+----+----+----+----+----+----+----+
 |    |    |    | WP |    |    | BB |    |
 +----+----+----+----+----+----+----+----+
 |    |    | WN |    | WP | WN |    |    |
 +----+----+----+----+----+----+----+----+
 | WP | WP | WP |    |    | WP | WP | WP |
 +----+----+----+----+----+----+----+----+
 | WR |    |    | WQ |    | WR | WK |    |
 +----+----+----+----+----+----+----+----+

This is what a chess board could look like at a particular point in the game. At some other point in the game it will have a different layout.

Each cell (square) in the above matrix is a Picturebox of an array of pictureboxes named picSq numbered 0 in the upper left corner through 63 in the lower right corner. Each picturebox will contain the value of what is on that cell (square). So in the above example picSq(0) will have " ", picSq(7) will have "BR", etc.

At any time during the game I want to click on a button and display the current board layout in a textbox so that it will look like the example above.

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>