我们想让用户输入一个值,该值是教师/用户检查他/她的课堂出勤的日期,然后一旦点击该按钮,在文本框中输入的值将在dgvcheckbox的标题中传输。所以请帮助我们解决这个问题。 。我们一直试图解决这个问题,但遗憾的是我们无法解决这个问题。所以我希望你们都能帮助我们!
答案 0 :(得分:0)
试试这个......
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.ColumnCount = 5
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
DataGridView1.Columns(0).Name = TextBox1.Text
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DataGridView1.Columns(1).Name = DateTimePicker1.Value.Date
End Sub
结束班
答案 1 :(得分:0)
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
DataGridView1.ColumnCount = 5
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
'----------------Clear Recent Data on DataGridView-------------------
Try
DataGridView1.Rows.Clear()
DataGridView1.Columns.Clear()
Catch ex As Exception
End Try
Try
DataGridView1.DataSource = Nothing
Catch ex As Exception
End Try
'----------------Display Again Record In DataGridView-----------------------
clsTR.displayTestResults(DataGridView1, "SELECT STUDENT_NAME AS [Student Name],MONDAY AS TextBox1.Text WHERE Something something")
End Sub
End Class
WHERE STUDENT_NAME和MONDAY是数据库列的名称 使用" AS"将替换数据库列STUDENT_NAME AS [学生姓名]