📄 productcategoryeditviewdialog.vb
字号:
Public Class ProductCategoryEditViewDialog
Private Shared defaultInstance As ProductCategoryEditViewDialog
Public Shared Function Instance(ByVal bindingSource As System.Windows.Forms.BindingSource) As ProductCategoryEditViewDialog
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
If defaultInstance Is Nothing Then
defaultInstance = New ProductCategoryEditViewDialog()
defaultInstance.ProductCategoryResultSetBindingSource.DataSource = bindingSource
End If
defaultInstance.productCategoryResultSetBindingSource.Position = bindingSource.Position
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
Return defaultInstance
End Function
Private ProductCategoryResultSet As SQLCEDataSourceQuickUI.ProductCategoryResultSet
Private Sub ProductCategoryEditViewDialog_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: Delete this line of code to remove the default AutoFill for 'SQLCEDataSourceQuickUI.ProductCategoryResultSet'.
ProductCategoryResultSet = New SQLCEDataSourceQuickUI.ProductCategoryResultSet
ProductCategoryResultSet.Bind(Me.ProductCategoryResultSetBindingSource)
End Sub
Private Const SSCE_M_NULLINVALID As Integer = 25005
Private Sub saveMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles saveMenuItem.Click
Try
Me.ProductCategoryResultSetBindingSource.EndEdit()
' Close the form
Me.DialogResult = DialogResult.OK
' If your underlying DataSource is a SqlCeResultSet, then EndEdit causes
' changes to applied to the database, hence you will get a SqlCeException
' if a constraint is violated, or some other error.
' If your data source is a DataTable, you will get an exception from System.Data
Catch sqlEx As System.Data.SqlServerCe.SqlCeException
If sqlEx.NativeError = SSCE_M_NULLINVALID Then
MessageBox.Show("You must specify a name")
Else
Throw
End If
End Try
End Sub
Private Sub cancelMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cancelMenuItem.Click
Me.ProductCategoryResultSetBindingSource.CancelEdit()
Me.DialogResult = DialogResult.Cancel
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -