0

私の(かなり)単純なアプリの下の画像の下に、そのコードがあります。レポートを実行するために、comboBox1 (場所)、comboBox2 (薬)、textBox1 (数量)、および textBox2 (日付) を CSV または Excel タイプのファイルにエクスポートする方法を知る必要があります。私は C# を初めて使用して 2 週間になりますが、この部分、具体的には職場で約 1 週間取り組んできたので、このヘルプを本当に利用できます。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
       public partial class Form1 : Form
        {
                public Form1()
                {
                    InitializeComponent();
                }

                private void button1_Click(object sender, EventArgs e)
                {

                }

                private void button2_Click(object sender, EventArgs e)
                {

                }

                private void button3_Click(object sender, EventArgs e)
                {
                    Application.Exit();
                }

                private void exitToolStripMenuItem_Click(object sender, EventArgs e)
                {
                    Application.Exit();
                }

                private void toolStripMenuItem1_Click(object sender, EventArgs e)
                {
                }

                private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
                {
                }

                private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
                {
                    dateTimePicker1.CustomFormat = "dd/MM/yyyy";
                    dateTimePicker1.MinDate = DateTime.Today;
                    dateTimePicker1.MaxDate = DateTime.Today;
                }

                private void label4_Click(object sender, EventArgs e)
                {
                }

                private void textBox2_TextChanged(object sender, EventArgs e)
                {
                    textBox2.Text = DateTime.Now.ToString();
                }


        }
}][1]
4

1 に答える 1

0
  • テキストボックスには .Text プロパティがあります
  • コンボボックスには .SelectedItem プロパティがあります

このようなテキストファイルに書き込むことができます...

http://msdn.microsoft.com/en-us/library/8bh11f1k.aspx

于 2012-03-12T20:08:59.283 に答える