C#五子棋棋子如何显示

来源:百度知道 编辑:UC知道 时间:2024/05/09 03:00:51
最近想写一个五子棋,可是刚入手,却不知道怎么显示棋子,还请各位赐教,顺便把源码发上来,大虾们看看有何错误,谢谢~~·
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace 五子棋
{
public partial class Form1 : Form
{
private bool isstart = false; /*判断游戏是否开始*/
private bool getloca = false; /*判断是否已经获取鼠标位置*/
private bool ispaused = false; /*判断有无暂停*/
private int seconds, minutes, hours; /*用来计算游戏进行时间*/
private bool[,] islocated = new bool[15, 15]; /*判断该位置是否已经下了棋子*/
private int[,] location = new int[15, 15]; /*记录鼠标点击位置*/
private int[,] chesscolor = new int[15, 15]; /*记录该点棋子颜色,0为无色(即此处还没有棋子),1为蓝色,2为红色*/
private int color = 1; /*判断棋子颜色,1

Public Class Form1

    Dim n, money As Integer, st As Boolean, a(1) As Image

    Private Sub init()

        Dim pbox As PictureBox

        P1.Image = a(0)

        P2.Image = a(0)

        P3.Image = a(0)

        n = Int(Rnd() * 3 + 1)

        pbox = Me.Controls("P" & n)

        pbox.Image = a(1)

    End Sub

    Private Sub init2(ByVal tf As Boolean