- Option Strict Off
- Imports SpreadsheetGear
- Imports System.Windows.forms
- Namespace ExcelViewVBDotnet
- Public Class StandardInterface '自定义名称
- '预留位置1
- '预留位置2
- Dim AW As SpreadsheetGear.IWorkbook,Range As SpreadsheetGear.IRange
- Dim CF,TS,VW As Object,YN As String
- Public Sub Workbook_Open(OldRoot As Object,NewRoot As Object,Excel As SpreadsheetGear.Windows.Forms.WorkbookView)
- Excel.GetLock()
- AW = Excel.ActiveWorkbook
- Range = AW.ActiveWorksheet.Range
- Excel.ReleaseLock()
- CF = OldRoot.Children(1) '绑定工具条触发,不能测试运行
- TS = OldRoot.Children(5) '绑定工具条区域,不能测试运行
-
-
-
-
- Dim BT2 As New Button
- BT2.Name = "BT_AN2"
- BT2.Content = "打印并保存新增"
- BT2.Margin = New Thickness(0, 2, 0, 2)
- BT2.Padding = New Thickness(13, 3, 13, 3)
- BT2.Style = Application.Current.Resources("ButtonStyle1")
- BT2.Foreground = Application.Current.Resources("Foreground1")
- AddHandler BT2.Click, Sub()
- ActiveWorkbook.WorkbookSet.GetLock()
- Range("F_2456").Value = Range("F_2456").Value + 1
- CF.Text = "#打印"
-
- Dim XHTimer As DispatcherTimer = New DispatcherTimer
- XHTimer.Interval = New TimeSpan(0, 0, 0, 1, 0)
- AddHandler XHTimer.Tick, Sub(s1, e1)
- ActiveWorkbook.WorkbookSet.GetLock()
- CF.Text="#保存并新增"
- ActiveWorkbook.WorkbookSet.ReleaseLock()
- XHTimer.Stop()
- End Sub
- XHTimer.Start()
-
- ActiveWorkbook.WorkbookSet.ReleaseLock()
- End Sub
- TS.Children.Insert(7, BT2)
-
-
-
-
- '位置:2保存3新增4提交5退回6打印7预览8导出9捕获10上传图片11上传附件12插入行13插多行14删除行15查找16最后
- End Sub'打开时执行事件
- Public Sub RangeSelection(sender As Object,e As SpreadsheetGear.Windows.Forms.RangeSelectionChangedEventArgs)
-
- End Sub'单元格选择后执行的事件
- Public Sub RangeChanged(sender As Object,e As SpreadsheetGear.Windows.Forms.RangeChangedEventArgs)
-
- End Sub'单元格编辑完成后执行事件
- Public Sub ButtunClick(sender As Object,e As SpreadsheetGear.Windows.Forms.ShapeActionEventArgs)
- ' if e.shape.name="BTEST" then
- ' Messagebox.show("0")
- ' End if
- End Sub'按钮/标签点击事件
- Public Sub FollowHyperlink(sender As Object)
-
- End Sub '暂不支持
- End Class
- '注:除事件字眼下可以自定义代码外的所有代码不允许改动,否则编译将有可能失败。
- End Namespace
复制代码 打印次数、打印、保存新增
|
|
hessen
2018-5-8 20:05:25