อยากได้โค้ดVBถ้าเราจะให้ในแต่ละ column and row อยากจะจัดขนาดตัวอักษรไม่เท่ากันแต่ละ Column ให้อัตโนมัติแบบครั้งเดียวจบเลย ไม่ต้องมา Save หลายรอบ ประมาณนี้ครับต้องทำไงครับ
Private Sub btn_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_save.Click
Try
Dim path As String = "d:\" + dateTimesStamp(99) + ".csv"
If Not File.Exists(path) Then
Using sw As StreamWriter = File.CreateText(path)
sw.WriteLine("Operator,Date,shift,operation,Time start,Time finish,Time total,JudgementG/NG,Why (reason),No.lot/break")
sw.Close()
End Using
End If
Using sw As StreamWriter = File.AppendText(path)
sw.WriteLine(tb_data1.Text + "," + tb_data2.Text + "," + cbx1.Text + "," + lb_work1.Text + "," + tb_time1.Text + "," + tb_time2.Text + "," + btn_taketime1.Text + "," + btn_ng1.Text + "," + tb_reason1.Text + "," + tb_amount.Text)
sw.WriteLine(tb_data1.Text + "," + tb_data2.Text + "," + cbx1.Text + "," + lb_work2.Text + "," + tb_time3.Text + "," + tb_time4.Text + "," + btn_taketime2.Text + "," + btn_ng2.Text + "," + tb_reason2.Text + "," + tb_amount.Text)
sw.WriteLine(tb_data1.Text + "," + tb_data2.Text + "," + cbx1.Text + "," + lb_work3.Text + "," + tb_time5.Text + "," + tb_time6.Text + "," + btn_taketime3.Text + "," + btn_ng3.Text + "," + tb_reason3.Text + "," + tb_amount.Text)
sw.Close()
End Using
Catch ex As Exception
End Try
You do not have the required permissions to view the files attached to this post.