Design Following type of form
Step 1 : first of all put two Groupbox onVB form.
Step 2 : Then put all radiobutton and put specific meaningful name.
ex:rb_ok,rb_okcancel
and design all things
step 3: add value in tag property of radio button
ok : 0
okcancel :1
abortRetryIgnore:2
YesNoCancel:3
YesNo :4
RetryCancel:5
Ouput :
Code :
Public Class Form1
Dim iconn, style As Integer
Private Sub rbok_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rb_ok.CheckedChanged, rb_okcancel.CheckedChanged, rb_abortretryignore.CheckedChanged, rbyesnocancel.CheckedChanged, rbyesno.CheckedChanged, rbretrycancel.CheckedChanged
style = Val(sender.tag)
End Sub
Private Sub rb_asterik_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rb_asterik.CheckedChanged, rb_error.CheckedChanged, rb_exclamation.CheckedChanged, rb_hand.CheckedChanged, rb_information.CheckedChanged, rb_none.CheckedChanged, rb_question.CheckedChanged, rb_stop.CheckedChanged, rb_warning.CheckedChanged
iconn = Val(sender.tag)
End Sub
Private Sub btndisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndisplay.Click
MsgBox("Message ", style + iconn)
End Sub
End Class
Download
ok : 0
okcancel :1
abortRetryIgnore:2
YesNoCancel:3
YesNo :4
RetryCancel:5
Ouput :
Code :
Public Class Form1
Dim iconn, style As Integer
Private Sub rbok_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rb_ok.CheckedChanged, rb_okcancel.CheckedChanged, rb_abortretryignore.CheckedChanged, rbyesnocancel.CheckedChanged, rbyesno.CheckedChanged, rbretrycancel.CheckedChanged
style = Val(sender.tag)
End Sub
Private Sub rb_asterik_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rb_asterik.CheckedChanged, rb_error.CheckedChanged, rb_exclamation.CheckedChanged, rb_hand.CheckedChanged, rb_information.CheckedChanged, rb_none.CheckedChanged, rb_question.CheckedChanged, rb_stop.CheckedChanged, rb_warning.CheckedChanged
iconn = Val(sender.tag)
End Sub
Private Sub btndisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndisplay.Click
MsgBox("Message ", style + iconn)
End Sub
End Class
Download
Customize msgbox style icon
Reviewed by Unknown
on
4:49 pm
Rating:
No comments: