How can I declare this in C# ?
. It gives error says : "Identifier expected" (under equal sign !)Code:private const LB_FINDSTRING = &H18F;
Printable View
How can I declare this in C# ?
. It gives error says : "Identifier expected" (under equal sign !)Code:private const LB_FINDSTRING = &H18F;
your need to say:
private const int LB_FINDSTRING = [HEXADECIMAL];
Of course [HEXADECIMAL] being the hexadecimal you are going to use to set the variable
the hex prefix in C# is 0x, not &H like VB.
you can convert any vb const by replacing the &H with 0xCode:public const int LB_FINDSTRING = 0x18F;
here's 3 random examples i run in a C# form and there vb formats :
Code:public const int PBM_SETBKCOLOR = 0x2001;
public const int PBM_SETBARCOLOR = 0x409;
public const int WM_CLOSE = 0x10;
'/// C# / C++ use this format 0x
'///
Private Const PBM_SETBKCOLOR As Long = &H2001
Private Const PBM_SETBARCOLOR As Long = &H409
Private Const WM_CLOSE As Long = &H10
'/// these are the vb versions.
Thanks for the little rule guys , worked perfect .