我对msgboxs有一些疑问 [英] i have some queries regarding msgboxs
本文介绍了我对msgboxs有一些疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将要做以下操作,以便在我在消息框中选择否"选项时不删除记录.我的codin如下所示
wat will i hve to do in order to not erase the record when i select the no option in message box.my codin is as written below
Dim cmd As New SqlCommand("delete from loading where loadingrefno=''" & loadingrefno.Text & "''", con)
Dim res As Integer = cmd.ExecuteNonQuery
If res = 1 Then
MsgBox("Are You sure you want to delete", MsgBoxStyle.YesNo, "Are You Sure")
Exit Sub
MsgBox("deleted succesfully")
clear()
AutoGenerate()
fill()
Else
MsgBox("details not found")
End If
推荐答案
一个消息框返回用户选择的值.
试试
A message box returns the value that the user has chosen.
Try
if (MsgBox("Are You sure you want to delete", MsgBoxStyle.YesNo, "Are You Sure")==DialogResult.Yes Then
//Delete code here
MsgBox("deleted succesfully")
clear()
AutoGenerate()
fill()
EndIf
尝试以下操作:
VB.NET MessageBox.显示示例
Try the following:
VB.NET MessageBox.Show Examples
这篇关于我对msgboxs有一些疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文