Dim e Dim dlg As New SaveFileDialog '定义一个新的SaveFileDialog dlg.Filter= "Excel文件|*.xls;*.xlsx" '设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮 Dim Tab As WinForm.TabControl = e.Form.Controls("TabControl1") For Each c As WinForm.Control In tab.Form.Controls If TypeOf c Is WinForm.Table Then '判断控件是否是是表格 Dim t As WinForm.Table = c '使用特定类型的变量引用控件 Dim CurTable As Table =t.Table curtable.SaveExcel(dlg.FileName, curtable.name) End If Next If MessageBox.Show("是否查看导出账页文件:"& dlg.FileName,"提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)=DialogResult.Yes Then Dim Proc As New Process Proc.File = dlg.FileName Proc.Start() End If End If
|