以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- messagebox问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=93858) |
-- 作者:刘林 -- 发布时间:2016/12/8 17:11:00 -- messagebox问题 Result = Messagebox.Show("是否确认导入到" & e.fORm.Controls("combobox1").value & "考试成绩表中","警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question) 提示时选定的按钮是“是",能否选定的按钮是"否"
|
-- 作者:有点色 -- 发布时间:2016/12/8 17:35:00 -- MessageBox.Show("XXX", "yyy", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) |
-- 作者:187398 -- 发布时间:2016/12/8 17:39:00 -- 我想做这样一个表:一个日期列,一个天数列,我要怎么做才能在日期列输入日期,在天数列输入天数,然后在另一列显示日期加天数后的新日期,求大神帮我 |
-- 作者:刘林 -- 发布时间:2016/12/8 21:24:00 -- Dim Result As DialogResult Result = Messagebox.Show("是否确认导入到" & e.fORm.Controls("combobox1").value & "考试成绩表中","警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) If Result = DialogResult.YES Then Dim dlg As new OpenFileDialog dlg.Filter = "Excel|*.xls;*.xlsx" Dim ksmc As String = trim(e.Form.controls("combobox1").value) Dim cmd As new SQLCommand cmd.C cmd.CommandText = "Sele ct * from{成绩} where 考试名称 = \'" & ksmc & "\'" Dim dt As DataTable = cmd.ExecuteReader(True) If dlg.ShowDialog = DialogResult.OK Then Dim Book As New XLS.Book(dlg.FileName) Dim Sheet As XLS.Sheet = Book.Sheets(0) Dim str As String = trim(e.Form.controls("combobox1").value) If sheet(0,0).value.Contains(str) Then For n As Integer = 2 To Sheet.Rows.Count -1 Dim dr As DataRow = dt.find("考试名称 = \'" & ksmc & "\' and 考号 = \'" & trim(sheet(n,0).value) & "\'") If dr IsNot Nothing Then For m As Integer = 1 To sheet.Cols.count -1 dr(trim(sheet(1,m).value) & "_B") = val(sheet(n,m).value) Next End If Next dt.save End If DataTables("成绩").load Else Messagebox.Show("你所选择的EXCL表第一行不包含考试名称,有可能你选错了表或选错了考试名称","警告") End If End If 老师我设计时为了防止用户选表时出现选错样表,但测试mess不出现呢? |
-- 作者:有点蓝 -- 发布时间:2016/12/8 21:40:00 -- Dim Result As DialogResult Result = Messagebox.Show("是否确认导入到" & e.fORm.Controls("combobox1").value & "考试成绩表中","警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) If Result = DialogResult.YES Then Dim dlg As new OpenFileDialog dlg.Filter = "Excel|*.xls;*.xlsx" Dim ksmc As String = trim(e.Form.controls("combobox1").value) Dim cmd As new SQLCommand cmd.C cmd.CommandText = "Sele ct * from{成绩} where 考试名称 = \'" & ksmc & "\'" Dim dt As DataTable = cmd.ExecuteReader(True) If dlg.ShowDialog = DialogResult.OK Then Dim Book As New XLS.Book(dlg.FileName) Dim Sheet As XLS.Sheet = Book.Sheets(0) Dim str As String = trim(e.Form.controls("combobox1").value) If sheet(0,0).value.Contains(str) Then For n As Integer = 2 To Sheet.Rows.Count -1 Dim dr As DataRow = dt.find("考试名称 = \'" & ksmc & "\' and 考号 = \'" & trim(sheet(n,0).value) & "\'") If dr IsNot Nothing Then For m As Integer = 1 To sheet.Cols.count -1 dr(trim(sheet(1,m).value) & "_B") = val(sheet(n,m).value) Next End If Next dt.save Else Messagebox.Show("你所选择的EXCL表第一行不包含考试名称,有可能你选错了表或选错了考试名称","警告") End If DataTables("成绩").load End If End If
|