I plan to create a class library for vb.net so I have the C# code source but there is an error So I have to fix the c# code source so that I can convert it to vb.net Please guide me to solve errors in the source code C#
Thanks
public partial class Form1 : Form
{
[DllImport("dwmapi.dll")]
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, ref int attrValue, int attrSize);
private static bool IsWindows10OrGreater(int build = -1)
{
return true;
}
private static bool UseImmersiveDarkMode(IntPtr handle, bool enabled)
{
try
{
if (Form1.IsWindows10OrGreater(17763))
{
int attr = 19;
if (Form1.IsWindows10OrGreater(18985))
{
attr = 20;
}
'error below line code
int num = (enabled > false) ? 1 : 0;
return Form1.DwmSetWindowAttribute(handle, attr, ref num, 4) == 0;
}
}
catch (Exception)
{
}
return false;
}
public Form1()
{
InitializeComponent();
}
}
1