DialogResult.Yes/No

rex028

Well-known member
Joined
Nov 18, 2004
Messages
50
Programming Experience
Beginner
VB.NET:
 MessageBox.Show("Are you sure to delete this record ? ", "Warning", MessageBoxButtons.YesNoCancel)
confirm()

VB.NET:
Private Function confirm()
		If DialogResult.Yes Then
			btnUpdate.Enabled = True
			btnDelete.Enabled = True
			btnPrint.Enabled = True
			btnNew.Enabled = True

			txtPOBranchID.Enabled = True
			txtPOID.Enabled = True
			colorTextField(False)
			txtPOBranchID.Text = "Yes"
			Exit Function
		End If
		If DialogResult.No Then
			btnUpdate.Enabled = True
			btnDelete.Enabled = True
			btnPrint.Enabled = True
			btnNew.Enabled = True

			txtPOBranchID.Enabled = True
			txtPOID.Enabled = True
			txtPOBranchID.Text = "No"

			colorTextField(False)
			Exit Function
		End If

	End Function


Whatever i click "Yes" or "No" .... the result is "YES"

how come ??????
 
Dim DLR as dialogresult
dlr = messagebox. show(....)
if DLR = dialogresult.yes then
...
end if
 
Back
Top