测试代码如下- Public Class Form1
- Inherits System.Windows.Forms.Form
- #Region " Windows フォーム デザイナで生成されたコード "
- Public Sub New()
- MyBase.New()
- ' この呼び出しは Windows フォーム デザイナで必要です。
- InitializeComponent()
- ' InitializeComponent() 呼び出しの後に初期化を追加します。
- End Sub
- ' Form は、コンポーネント一覧に後処理を実行するために dispose をオーバーライドします。
- Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
- If disposing Then
- If Not (components Is Nothing) Then
- components.Dispose()
- End If
- End If
- MyBase.Dispose(disposing)
- End Sub
- ' Windows フォーム デザイナで必要です。
- Private components As System.ComponentModel.IContainer
- ' メモ : 以下のプロシージャは、Windows フォームデザイナで必要です。
- 'Windows フォーム デザイナを使って変更してください。
- ' コード エディタを使って変更しないでください。
- Friend WithEvents FpSpread1 As FarPoint.Win.Spread.FpSpread
- Friend WithEvents FpSpread1_Sheet1 As FarPoint.Win.Spread.SheetView
- Friend WithEvents Button1 As System.Windows.Forms.Button
- <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
- Me.FpSpread1 = New FarPoint.Win.Spread.FpSpread
- Me.FpSpread1_Sheet1 = New FarPoint.Win.Spread.SheetView
- Me.Button1 = New System.Windows.Forms.Button
- CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).BeginInit()
- CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).BeginInit()
- Me.SuspendLayout()
- '
- 'FpSpread1
- '
- Me.FpSpread1.Location = New System.Drawing.Point(32, 8)
- Me.FpSpread1.Name = "FpSpread1"
- Me.FpSpread1.Sheets.AddRange(New FarPoint.Win.Spread.SheetView() {Me.FpSpread1_Sheet1})
- Me.FpSpread1.Size = New System.Drawing.Size(480, 104)
- Me.FpSpread1.TabIndex = 0
- '
- 'FpSpread1_Sheet1
- '
- Me.FpSpread1_Sheet1.Reset()
- 'Formulas and custom names must be loaded with R1C1 reference style
- Me.FpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1
- Me.FpSpread1_Sheet1.Columns.Get(1).BackColor = System.Drawing.Color.FromArgb(CType(224, Byte), CType(224, Byte), CType(224, Byte))
- Me.FpSpread1_Sheet1.Columns.Get(1).Locked = True
- Me.FpSpread1_Sheet1.RowHeader.Columns.Default.Resizable = False
- Me.FpSpread1_Sheet1.SheetName = "Sheet1"
- Me.FpSpread1_Sheet1.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.A1
- '
- 'Button1
- '
- Me.Button1.Location = New System.Drawing.Point(72, 128)
- Me.Button1.Name = "Button1"
- Me.Button1.TabIndex = 1
- Me.Button1.Text = "Button1"
- '
- 'Form1
- '
- Me.AutoScaleBaseSize = New System.Drawing.Size(5, 12)
- Me.ClientSize = New System.Drawing.Size(616, 262)
- Me.Controls.Add(Me.Button1)
- Me.Controls.Add(Me.FpSpread1)
- Me.Name = "Form1"
- Me.Text = "Form1"
- CType(Me.FpSpread1, System.ComponentModel.ISupportInitialize).EndInit()
- CType(Me.FpSpread1_Sheet1, System.ComponentModel.ISupportInitialize).EndInit()
- Me.ResumeLayout(False)
- End Sub
- #End Region
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- Me.FpSpread1.EditModePermanent = True
- End Sub
- Private Sub FpSpread1_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles FpSpread1.Enter
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- End Sub
- Private Sub FpSpread1_EnterCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EnterCellEventArgs) Handles FpSpread1.EnterCell
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- End Sub
- Private Sub FpSpread1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles FpSpread1.GotFocus
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- End Sub
- Private Sub FpSpread1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles FpSpread1.Leave
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- End Sub
- Private Sub FpSpread1_LeaveCell(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.LeaveCellEventArgs) Handles FpSpread1.LeaveCell
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- End Sub
- Private Sub FpSpread1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles FpSpread1.Validating
- _DebugWriteLog(System.Reflection.MethodBase.GetCurrentMethod.Name, "Start")
- End Sub
- Private Sub _DebugWriteLog(ByVal methodName As String, ByVal logContent As String)
- Dim logTime As String = Now.ToString("yyyy/MM/dd HHss fff")
- Dim logMessage As String = String.Format("{0}-[{1}]-{2}", logTime, methodName, logContent)
- System.Console.WriteLine(logMessage)
- End Sub
- End Class
复制代码 |