is a 'method', which is not valid in the given context C# Error
Im very new to C# (like a week) and im having a problem calling one of the
functions/methods i have created in an If/else statement.
This is a registration system and if the program can find an active DB
connection it will use the online version of the program, but if no DB
connection then use the offline version.
That is where the issue is. I have an IF/Else statement on the Online
version which then calls the offline version.
Any help is great!
Here is the code:
public partial class Registration : Form
{
public Registration()
{
InitializeComponent();
}
#region Globals
internal const int SC_CLOSE = 0xF060; //close button's code
in windows api
internal const int MF_GRAYED = 0x1; //disabled button
status (enabled = false)
internal const int MF_ENABLED = 0x00000000; //enabled button status
internal const int MF_DISABLED = 0x00000002; //disabled button status
[DllImport("user32.dll")] //Importing user32.dll for calling required
function
private static extern IntPtr GetSystemMenu(IntPtr HWNDValue, bool
Revert);
/// HWND: An IntPtr typed handler of the related form
/// It is used from the Win API "user32.dll"
[DllImport("user32.dll")] //Importing user32.dll for calling required
function again
private static extern int EnableMenuItem(IntPtr tMenu, int targetItem,
int targetStatus);
No comments:
Post a Comment