cmd Key overriding
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
Keys key = keyData & ~(Keys.Shift
Keys.Control);
switch (key)
{
case Keys.D:
if ((keyData & Keys.Control) != 0 && (keyData & Keys.Shift) != 0)
{
if (m_debuggingForm == null)
{
TPSMessageBox.Show(this, "Debug Mode Activated");
m_debuggingForm = new Debugging_Form();
m_debuggingForm.Show();
m_debuggingForm.SetDesktopLocation(this.Left + (this.Width - m_debuggingForm.Width) / 2, this.Top + (this.Height - m_debuggingForm.Height) / 2);
}
else if (m_debuggingForm.IsDisposed)
{
TPSMessageBox.Show(this, "Debug Mode Activated");
m_debuggingForm = new Debugging_Form();
m_debuggingForm.Show();
m_debuggingForm.SetDesktopLocation(this.Left + (this.Width - m_debuggingForm.Width) / 2, this.Top + (this.Height - m_debuggingForm.Height) / 2);
}
else
{
m_debuggingForm.BringToFront();
}
return true;
}
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
{
Keys key = keyData & ~(Keys.Shift
Keys.Control);
switch (key)
{
case Keys.D:
if ((keyData & Keys.Control) != 0 && (keyData & Keys.Shift) != 0)
{
if (m_debuggingForm == null)
{
TPSMessageBox.Show(this, "Debug Mode Activated");
m_debuggingForm = new Debugging_Form();
m_debuggingForm.Show();
m_debuggingForm.SetDesktopLocation(this.Left + (this.Width - m_debuggingForm.Width) / 2, this.Top + (this.Height - m_debuggingForm.Height) / 2);
}
else if (m_debuggingForm.IsDisposed)
{
TPSMessageBox.Show(this, "Debug Mode Activated");
m_debuggingForm = new Debugging_Form();
m_debuggingForm.Show();
m_debuggingForm.SetDesktopLocation(this.Left + (this.Width - m_debuggingForm.Width) / 2, this.Top + (this.Height - m_debuggingForm.Height) / 2);
}
else
{
m_debuggingForm.BringToFront();
}
return true;
}
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
댓글
댓글 쓰기