📄 frmselectlevel.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace PushBox
{
public partial class frmSelectLevel : Form
{
public frmSelectLevel(int level)
{
InitializeComponent();
textBox1.Text = level.ToString();
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
try
{
if ((Keys)e.KeyChar == Keys.Back) return;
int.Parse(e.KeyChar.ToString());
}
catch { e.Handled = true; }
}
private void button1_Click(object sender, EventArgs e)
{
if (File.Exists(Application.StartupPath + "\\Level\\Level" + int.Parse(textBox1.Text).ToString() + ".hmap"))
{
frmMain mainForm = (frmMain)this.Owner;
mainForm.Level = int.Parse(textBox1.Text);
DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show("第【★-"+ int.Parse(textBox1.Text).ToString()+"-★】关不存在!","信息提示",MessageBoxButtons.OK,MessageBoxIcon.Exclamation);
textBox1.Focus();
textBox1.SelectAll();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -