-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_file.cs
More file actions
114 lines (108 loc) · 2.55 KB
/
edit_file.cs
File metadata and controls
114 lines (108 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace computer1
{
public partial class edit_file : Form
{
private string text1 = "";
private string text2 = "";
private string text3 = "";
public edit_file()
{
InitializeComponent();
this.DialogResult = DialogResult.Cancel;
}
//获取文本框内的值
private void text1_Box(object sender, EventArgs e)
{
this.text1 = this.textBox1.Text;
}
private void text2_Box(object sender, EventArgs e)
{
this.text2 = this.textBox2.Text;
}
private void text3_Box(object sender, EventArgs e)
{
this.text3 = this.textBox3.Text;
}
//定义属性值
//文件名
public string file_name
{
get
{
return text1;
}
set
{
this.textBox1.Text = value;
}
}
//文件类型
public string file_type
{
get
{
return text2;
}
set
{
textBox2.Text = value;
}
}
//文本框
public string context
{
get
{
return text3;
}
set
{
textBox3.Text = value;
}
}
public bool Enable2
{
set
{
textBox2.Enabled = value;
}
}
public bool Enable3
{
set
{
this.textBox3.Enabled = value;
}
}
//设置按钮操作
private void ensure(object sender, EventArgs e)
{
if(this.textBox1.Text=="")
{
MessageBox.Show("请输入文件名!");
return;
}
if(this.textBox2.Enabled==true && this.textBox2.Text=="")
{
MessageBox.Show("请输入文件类型!");
return;
}
this.DialogResult = DialogResult.OK;
this.Close();
}
private void quit(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
}