G
Guest
Hello
I'm sure that anyone with VB.NET would be familiar with the msgbox parameter syntax
Dim msg As Strin
Dim title As Strin
Dim style As MsgBoxStyl
Dim response As MsgBoxResul
msg = "Do you want to continue?" ' Define message
style = MsgBoxStyle.DefaultButton2 Or
MsgBoxStyle.Critical Or MsgBoxStyle.YesN
title = "MsgBox Demonstration" ' Define title
' Display message
response = MsgBox(msg, style, title
So I pass in something like
style = MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.Critical Or MsgBoxStyle.YesN
And it knows that I want a message box with a Yes and a No button, an exclamation point icon, and make the No button the default
DefaultButton2 = 256, critical = 16, and YesNo =
When I do the style = MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.Critical Or MsgBoxStyle.YesNo, I see style = 276
The "+" operator will work as well, but the Intellisense doesn't work when I do this
I can't find this functionality of the "Or" operator documented anywhere
What I'm trying to do is something like
Begin Pseudo code ===============
Private Enum MyEnu
MyVal0=
MyVal1=
MyVal2=
End Enu
Dim MyVar as MyEnu
If MyCriteria1= True The
MyVar = MyVal
End I
If MyCriteria2 True The
MyVar = MyVar Or MyVal
End I
If MyVar Was assigned to MyVal0 The
'Do Somethin
If MyVar Was Assigned to MyVal1 The
'Do Somethin
End Pseudo code ===============
I can change MyEnum such that MyVal0 = 4, MyVal1 = 16, etc. and then do a
If MyVar Mod MyVal1 = 0 the
MyVar -= MyVal
If MyVar Mod MyVal0 = 0 the
'Do somethin
'Go to the next smallest MyVa
Any idea how the messagebox function does it
Thanks
Eric
I'm sure that anyone with VB.NET would be familiar with the msgbox parameter syntax
Dim msg As Strin
Dim title As Strin
Dim style As MsgBoxStyl
Dim response As MsgBoxResul
msg = "Do you want to continue?" ' Define message
style = MsgBoxStyle.DefaultButton2 Or
MsgBoxStyle.Critical Or MsgBoxStyle.YesN
title = "MsgBox Demonstration" ' Define title
' Display message
response = MsgBox(msg, style, title
So I pass in something like
style = MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.Critical Or MsgBoxStyle.YesN
And it knows that I want a message box with a Yes and a No button, an exclamation point icon, and make the No button the default
DefaultButton2 = 256, critical = 16, and YesNo =
When I do the style = MsgBoxStyle.DefaultButton2 Or MsgBoxStyle.Critical Or MsgBoxStyle.YesNo, I see style = 276
The "+" operator will work as well, but the Intellisense doesn't work when I do this
I can't find this functionality of the "Or" operator documented anywhere
What I'm trying to do is something like
Begin Pseudo code ===============
Private Enum MyEnu
MyVal0=
MyVal1=
MyVal2=
End Enu
Dim MyVar as MyEnu
If MyCriteria1= True The
MyVar = MyVal
End I
If MyCriteria2 True The
MyVar = MyVar Or MyVal
End I
If MyVar Was assigned to MyVal0 The
'Do Somethin
If MyVar Was Assigned to MyVal1 The
'Do Somethin
End Pseudo code ===============
I can change MyEnum such that MyVal0 = 4, MyVal1 = 16, etc. and then do a
If MyVar Mod MyVal1 = 0 the
MyVar -= MyVal
If MyVar Mod MyVal0 = 0 the
'Do somethin
'Go to the next smallest MyVa
Any idea how the messagebox function does it
Thanks
Eric