How to write Enum from C# on Visual Basic 2008?



Hello. In project Visual Studio 2008, Visual C#, Windows Forms Application,
I have written down such code on C# without errors:



[Flags]

public enum WindowStyles : uint

{

Overlapped = 0x00000000,

Popup = 0x80000000,

Child = 0x40000000,

Minimize = 0x20000000,

Visible = 0x10000000,

Disabled = 0x08000000,

ClipSiblings = 0x04000000,

ClipChildren = 0x02000000,

Maximize = 0x01000000,

Caption = 0x00C00000,

Border = 0x00800000,

DialogFrame = 0x00400000,

VerticalScroll = 0x00200000,

HorizontalScroll = 0x00100000,

SystemMenu = 0x00080000,

ThickFrame = 0x00040000,

Group = 0x00020000,

TabStop = 0x00010000,

MinimizeBox = 0x00020000,

MaximizeBox = 0x00010000,

}

WindowStyles style = WindowStyles.Overlapped |

WindowStyles.Caption |

WindowStyles.SystemMenu |

WindowStyles.ThickFrame |

WindowStyles.MinimizeBox |

WindowStyles.MaximizeBox;

string WindowClassName = "MD3DWindowClass";

string windowTitle = "Game2";

int windowSize_Width = 648;

int windowSize_Height = 525;

int x = 0;

int y = 0;

private void Form1_Load(object sender, EventArgs e)

{

MessageBox.Show(

"1-Ê ÐÁÒÁÍÅÔÒ = " + Convert.ToString(0) +

", WindowClassName = " +

Convert.ToString(WindowClassName) +

", windowTitle = " +

Convert.ToString(windowTitle) +

", style = " + Convert.ToString(style) +

", x = " + Convert.ToString(x) +

", y = " + Convert.ToString(y) +

", windowSize.Width = " +

Convert.ToString(windowSize_Width) +

", windowSize.Height = " +

Convert.ToString(windowSize_Height) +

", IntPtr.Zero = " +

Convert.ToString(IntPtr.Zero) +

", IntPtr.Zero = " +

Convert.ToString(IntPtr.Zero) +

", IntPtr.Zero = " +

Convert.ToString(IntPtr.Zero) +

", IntPtr.Zero = " +

Convert.ToString(IntPtr.Zero));

}

Panel MessageBox.Show shows the following correct information for variable
"style":

style = TabStop, Group, ThickFrame, SystemMenu, Caption



The same code, I have copied in the project Visual Studio 2008, Visual
Basic, Windows Forms Application in such kind on Visual Basic:



<Flags()> _

Public Enum WindowStyles As UInteger

Overlapped = &H0

Popup = &H80000000UL

Child = &H40000000

Minimize = &H20000000

Visible = &H10000000

Disabled = &H8000000

ClipSiblings = &H4000000

ClipChildren = &H2000000

Maximize = &H1000000

Caption = &HC00000

Border = &H800000

DialogFrame = &H400000

VerticalScroll = &H200000

HorizontalScroll = &H100000

SystemMenu = &H80000

ThickFrame = &H40000

Group = &H20000

TabStop = &H10000

MinimizeBox = &H20000

MaximizeBox = &H10000

End Enum



Dim style As WindowStyles = _

WindowStyles.Overlapped Or _

WindowStyles.Caption Or _

WindowStyles.SystemMenu Or _

WindowStyles.ThickFrame Or _

WindowStyles.MinimizeBox Or _

WindowStyles.MaximizeBox



Dim WindowClassName As String = "MD3DWindowClass"

Dim windowTitle As String = "Game2"

Dim windowSize_Width As Integer = 648

Dim windowSize_Height As Integer = 525

Dim x As Integer = 0

Dim y As Integer = 0



Private Sub Form1_Load(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles MyBase.Load

MsgBox("1-Ê ÐÁÒÁÍÅÔÒ = " & CStr(0) _

& ", WindowClassName = " _

& CStr(WindowClassName) _

& ", windowTitle = " & CStr(windowTitle) _

& ", style = " & CStr(style) _

& ", x = " & CStr(x) & ", y = " & CStr(y) _

& ", windowSize.Width = " _

& CStr(windowSize_Width) _

& ", windowSize.Height = " _

& CStr(windowSize_Height) _

& ", IntPtr.Zero = " & CStr(IntPtr.Zero) _

& ", IntPtr.Zero = " & CStr(IntPtr.Zero) _

& ", IntPtr.Zero = " & CStr(IntPtr.Zero) _

& ", IntPtr.Zero = " & CStr(IntPtr.Zero))

End Sub



Panel MsgBox shows the following erroneous information for variable "style":

style = 13565952

Inform, please, how correctly to write down this code on Visual Basic?

Many thanks, Zharkov.


.