public void LockAndUnlock()
{
//--We need to load and unload the image
if (FlagForLockUnlock == 0)
{
//Edit mode is dissabled //Edit OFF section
//--Load image lock image
string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string NewDirectory = Path.GetFullPath(Path.Combine(dir, @"..\"));
string file = NewDirectory + @"Images\lock.png";
Bitmap SOME = new Bitmap(Image.FromFile(file));
Bitmap bp = new Bitmap(SOME, pb_lock_unlock.Width, pb_lock_unlock.Height);
pb_lock_unlock.Image = bp;//Image.FromFile(file);
//==Code form edit OFF
FlagForCntdBG_Update = 1;//On currently
FlagForDissableLeftAndRightClicksInChart = 1;//turn on
//==End of edit OFF
FlagForLockUnlock = 1;
lb_realtimeshow.Text = "Real Time Mode";
}
else
{
//Edit mode is enable
//--Load image lock image
string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string NewDirectory = Path.GetFullPath(Path.Combine(dir, @"..\"));
string file = NewDirectory + @"Images\unlock.png";
Bitmap SOME = new Bitmap(Image.FromFile(file));
Bitmap bp = new Bitmap(SOME, pb_lock_unlock.Width, pb_lock_unlock.Height);
pb_lock_unlock.Image = bp;//Image.FromFile(file);
//==============Edit ON section these flags make the Edit on=====//
FlagForCntdBG_Update = 0;//OFF currently
FlagForDissableLeftAndRightClicksInChart = 0;//==TURN OFF
//==============End of edit on flag decleration =========//
FlagForLockUnlock = 0;
lb_realtimeshow.Text = "Edit Mode";
}
}