C# Snippets


Question_RowDelete

Public Shared Function Question_RowDelete(Optional ByVal iDefaultButton As System.Int32 = 1,
Optional ByVal bFlagError As Boolean = False) _
As Boolean
Dim breturn As Boolean
Dim objreturn As System.Windows.Forms.DialogResult
Dim objdefaultbutton As System.Windows.Forms.MessageBoxDefaultButton

Select Case iDefaultButton
Case 1 : objdefaultbutton = System.Windows.Forms.MessageBoxDefaultButton.Button1
Case 2 : objdefaultbutton = System.Windows.Forms.MessageBoxDefaultButton.Button2
End Select

objreturn = System.Windows.Forms.MessageBox.Show(
"Are you sure you want to delete this row ?",
gobjSolution.SolutionFormTitle,
System.Windows.Forms.MessageBoxButtons.YesNo,
System.Windows.Forms.MessageBoxIcon.Question,
objdefaultbutton)

If objreturn = System.Windows.Forms.DialogResult.Yes Then breturn = True
If objreturn = System.Windows.Forms.DialogResult.No Then breturn = False

'sets the flag to an error
clsError.ErrorFlagChange(bFlagError)

Return breturn
End Function

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top