المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : CheckBox initial value



C# Programming
08-28-2009, 05:31 PM
This is part of my program that activates the mouse movement sensor once a checkbox is ticked.

What i want is for it to be activated by default.

I've tried editing the checkbox in designer view of the form, setting the value to true, but the mouse movement is still not picked up until the checkbox is unchecked then rechecked.

Im new to C#, im assuming it's something to do with "CheckedChanged"....?

This is the code for the checkbox:

private void checkBoxOnMouseMove_CheckedChanged(object sender, EventArgs e)
{
if (checkBoxOnMouseMove.Checked)
{
HookManager.MouseMove += HookManager_MouseMove;
}
else
{
HookManager.MouseMove -= HookManager_MouseMove;
}

Any help at all would be greatly appreciated http://barakasoft.com/script/Forums/Images/smiley_smile.gif