How to convert code in Visual Basic to C#
This is code in VB.NET:
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim CP As CreateParams = MyBase.开发者_JS百科CreateParams
CP.Style = &HA0000
Return CP
End Get
And I want to convert it into C#. As per my assumption below is how the code in C# will look like. For the above code where CP.Style = &HA000
, what should I put in
C# code. I have left it empty.
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style =
return cp;
}
}
You need:
CreateParams cp = base.CreateParams;
cp.Style = 0xA000;
return cp;
0x
is the prefix for a hex integer literal in C#, instead of &H
in VB.
Missing line:
cp.Style = 0xA0000;
protected override CreateParams CreateParams {
get {
CreateParams CP = base.CreateParams;
CP.Style = 0xa0000;
return CP;
}
}
Try this convertor
精彩评论