의 C# - Windows 응용 프로그램 - 저장 목록 그때 다른 텍스트 상자에 배치 텍스트 상자에서 입력을 취득하는 간단한 TO-DOS 프로그램을 만들었습니다
. 그 옆의 체크 박스를 사용하면 을 제외하고 모두 괜찮습니다. 예를 들어 목록을 저장할 수 없습니다. 항목 및 완료 여부. 누구든지이 항목 목록을 저장할 수있게 도와주세요.
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 TO_DOs
{
public partial class Form1 : Form
{
private bool text1, text2, text3, text4, text5, text6, text7, text8;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (text1 == false)
{
textBox2.Text = textBox1.Text;
}
else if (text2 == false)
{
textBox3.Text = textBox1.Text;
}
else if (text3 == false)
{
textBox4.Text = textBox1.Text;
}
else if (text4 == false)
{
textBox5.Text = textBox1.Text;
}
else if (text5 == false)
{
textBox6.Text = textBox1.Text;
}
else if (text6 == false)
{
textBox7.Text = textBox1.Text;
}
else if (text7 == false)
{
textBox8.Text = textBox1.Text;
}
else if (text8 == false)
{
textBox9.Text = textBox1.Text;
}
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
text1 = true;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
text2 = true;
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
text3 = true;
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
text4 = true;
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
text5 = true;
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
text6 = true;
}
private void textBox8_TextChanged(object sender, EventArgs e)
{
text7 = true;
}
private void textBox9_TextChanged(object sender, EventArgs e)
{
text8 = true;
}
}
}
어디에서 목록을 저장 하시겠습니까? 그리고 어느 목록에? 나는 아무 것도 볼 수 없다 –
배열, 목록, 콜렉션 등을 사용하는 법을 배우고 자 할 때, 코드를 기반으로 아이템을 저장하기위한 변수가 없기 때문에 거기에서부터 시작할 수 있습니다. –
내가 프로그램을 실행할 때 항목을 물어볼 것이고 나는 그것을 틱 할 수있다. 그리고 모두 잘 작동하지만 프로그램을 닫고 다시 열면 다시 입력을 요청할 것이다. 그래서 나는 프로그램을 마치면 내가 한 것을 구할 수 있기를 원한다. 예. 파일에 저장 어딘가 : {1} 쇼핑 - 사실. 그렇다면이 프로그램은 마침표로 쇼핑을하면서 다시로드 할 수 있음을 의미합니다.감사합니다. – Bilbo