Form1.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace shudu
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int ktabindex = 0;
Color[] color = { Color.LightCyan, Color.Beige, Color.LightSteelBlue, Color.FloralWhite };
int[,] seedArray=new int[9,9]{{9,7,8,3,1,2,6,4,5},{3,1,2,6,4,5,9,7,8},{6,4,5,9,7,8,3,1,2},{7,8,9,1,2,3,4,5,6},{1,2,3,4,5,6,7,8,9},{4,5,6,7,8,9,1,2,3},{8,9,7,2,3,1,5,6,4},{2,3,1,5,6,4,8,9,7},{5,6,4,8,9,7,2,3,1}};
for (int i = 1; i < 10; i++)
{
for (int j = 1; j < 10; j++)
{
Random r1 = new Random();
TextBox tb = new TextBox();
tb.MaxLength = 1;
tb.Width = 20;
tb.Height = 20;
tb.Left = 20 * (i - 1)+i*4;
tb.Top = 20 * (j - 1)+j*4;
tb.Name = "tb" + i.ToString() + j.ToString();
tb.TabIndex = ktabindex;
tb.KeyDown += new KeyEventHandler(KeyDown1);
tb.KeyUp += new KeyEventHandler(KeyUp1);
tb.TextAlign = HorizontalAlignment.Center;
if (r1.Next(100) > r1.Next(110))
tb.Text = seedArray[i-1, j-1].ToString();
if (i < 4 && j < 4 || i > 6 && j > 6||(j>3&&j<7&&i>3&&i<7)||i>6&&j<4||j>6&&i<4)
tb.BackColor = color[0];
panel1.Controls.Add(tb);
}
}
}
private void KeyUp1(object sender, KeyEventArgs e)
{
if(!"123456789".Contains(((TextBox)sender).Text))
((TextBox)sender).Text = "" ;
if (((TextBox)sender).Text.Length == 1)
SendKeys.Send("\t");
}
private void KeyDown1(object sender, KeyEventArgs e)
{
if (e.KeyValue < 97 || e.KeyValue > 107)
后面还有 93 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。