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 ??????
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Dim DLR as dialogresult
dlr = messagebox. show(....)
if DLR = dialogresult.yes then
...
end if
 
Top Bottom