数独游戏c#源代码


一个比较适合用来交作业的c#项目,内容小但是代码还是适合初学者的。
资源截图
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QiuQiu.Dushu
{
    public partial class DushuControl : UserControl
    {
        private int _leftBlank;//左空
        private int _rightBlank;//右空
        private int _topBlank;//上空
        private int _bottomBlank;//下空
        private int _cellWidth;//单元格宽
        private int _cellHeight;//单元格高
        private int _lineWidth;//细线宽
        private int _line2Width;//粗线宽
        private int _sideLength;//边长
        private int _curRow;//当前行
        private int _curCol;//当前列
        private Color _lineColor;//线颜色
        private Color _textColor;//字颜色
        private Color _textConstColor;//常数字颜色
        private Font _textFront;//字体
        private NumberButton[] _buttons;//按钮
        private bool _buttonAdded;//是否已经添加按钮
        private bool _isManSet;//是否在人工添加数字

        private DushuoData _data;//独数数据

        /// 
        /// 独数数据
        /// 

        internal DushuoData Data
        {
            get { return _data; }
            set
            {
                _data = value;
                if (_buttonAdded)
                {
                    UpdateButtons();
                }
                else
                {
                    AddButtons();
                }
            }
        }

        public DushuControl()
        {
            InitializeComponent();

            _leftBlank = 40;
            _rightBlank = 40;
            _topBlank = 40;
            _bottomBlank = 40;
            _cellHeight = 40;
            _cellWidth = 40;
            _lineWidth = 1;
            _line2Width = 2;
            _sideLength = 9;
            _lineColor = Color.Black;

            _textColor = Color.Blue;
            _textConstColor = Color.Red;
            _textFront = new Font(new FontFamily(“宋体“) _cellWidth / 2 Fontstyle.Bold);

            base.Size = new Size(_sideLength * _cellWidth + _leftBlank + _rightBlank _sideLength * _cellHeight + _topBlank + _bottomBlank);
        }

        /// 
        /// 添加按钮
        /// 

        private void AddButtons()
        {
            _buttons = new NumberButton[_sideLength _sideLength];
            if (_data == null)
                return;
            string str;

            //定义按钮
            NumberButton numbutton = new NumberButton();
            numbutton.Font = _textFront;
            numbutton.Size = new Size(_cellWidth - 2 _cellHeight - 2);
            numbutton.ForeColor = _textColor;

            //定义常数按钮
            NumberButton constbutton = new NumberButton();
            constbutton.Font = _textFront;
            constbutton.Size = new Size(_cellWidth - 2 _cellHeight - 2);
            constbutton.ForeColor = _textConstColor;

            for (int r = 0; r < _

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        161  2015-06-14 14:43  C#数独游戏源代码app.config

     文件       4872  2007-12-31 16:27  C#数独游戏源代码BackupDushu.csproj

     文件       1591  2007-12-30 23:25  C#数独游戏源代码BackupDushu.sln

    ..A..H.     31744  2008-03-04 14:45  C#数独游戏源代码BackupDushu.v12.suo

     文件      10455  2007-12-31 22:09  C#数独游戏源代码BackupDushuControl.cs

     文件       2401  2007-12-31 18:30  C#数独游戏源代码BackupDushuControl.Designer.cs

     文件       5814  2007-12-31 18:30  C#数独游戏源代码BackupDushuControl.resx

     文件      27253  2008-03-04 12:54  C#数独游戏源代码BackupDushuoData.cs

     文件       3246  2007-12-31 22:00  C#数独游戏源代码BackupMainForm.cs

     文件       5752  2007-12-31 20:29  C#数独游戏源代码BackupMainForm.Designer.cs

     文件       5814  2007-12-31 20:29  C#数独游戏源代码BackupMainForm.resx

     文件       1241  2007-12-31 15:32  C#数独游戏源代码BackupNumberButton.cs

     文件       3512  2007-12-31 14:08  C#数独游戏源代码BackupProgram.cs

     文件       1342  2007-12-28 17:24  C#数独游戏源代码BackupPropertiesAssemblyInfo.cs

     文件       2848  2007-12-28 17:25  C#数独游戏源代码BackupPropertiesResources.Designer.cs

     文件       5612  2007-12-28 17:24  C#数独游戏源代码BackupPropertiesResources.resx

     文件       1110  2007-12-28 17:25  C#数独游戏源代码BackupPropertiesSettings.Designer.cs

     文件        249  2007-12-28 17:24  C#数独游戏源代码BackupPropertiesSettings.settings

     文件       2185  2007-12-31 16:58  C#数独游戏源代码BackupSelectButton.cs

     文件       2591  2007-12-31 17:07  C#数独游戏源代码BackupSelectNumberPanel.cs

     文件       1328  2007-12-31 16:17  C#数独游戏源代码BackupSelectNumberPanel.Designer.cs

     文件       5814  2007-12-31 16:17  C#数独游戏源代码BackupSelectNumberPanel.resx

     文件      24064  2007-12-31 18:30  C#数独游戏源代码inDebugDushu.exe

     文件      75264  2007-12-31 18:30  C#数独游戏源代码inDebugDushu.pdb

     文件      14680  2007-12-31 18:30  C#数独游戏源代码inDebugDushu.vshost.exe

     文件        473  2007-02-21 18:51  C#数独游戏源代码inDebugDushu.vshost.exe.manifest

     文件      25088  2015-06-14 16:09  C#数独游戏源代码inReleaseDushu.exe

     文件        161  2015-06-14 14:43  C#数独游戏源代码inReleaseDushu.exe.config

     文件      65024  2015-06-14 16:09  C#数独游戏源代码inReleaseDushu.pdb

     文件      10271  2008-01-08 10:25  C#数独游戏源代码inReleaseDushu.rar

............此处省略79个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)