寻找一些问题的帮助我有
对不起,如果这个问题已被提出,我找不到类似的东西.
这个想法是当点击图片框时将图像更改为ON.
如果图片框保持2秒以上以打开新表格并将图片框保留为OFF.
但是,如果点击图片框然后保持2秒然后返回我需要图片框状态保持为ON.
这是我到目前为止所尝试的.
我相信为了正常工作我需要阻止MouseUp事件发生.
有什么方法可以在Tick发生时停止MouseUp吗?
有没有更简单/更好的方法来做到这一点?
任何帮助,将不胜感激.
private void time_HoldDownInternal_Tick(object sender, EventArgs e)
{
time_HoldDownInternal.Enabled = false;
time_HoldDownInternal.Interval = 1000;
form1show.Visible = true;
}
private void pb_pictureBoxTest_MouseDown(object sender, MouseEventArgs e)
{
mainMenuVariables.mousedown = true;
time_HoldDownInternal.Enabled = true;
}
private void pb_pictureBoxTest_MouseUp(object sender, MouseEventArgs e)
{
mainMenuVariables.mousedown = false;
//MessageBox.Show("mouse up");
time_HoldDownInternal.Enabled = false;
time_HoldDownInternal.Interval = 1000;
}
private void pb_pictureBoxTest_Click(object sender, EventArgs e)
{
if (mainMenuVariables.mousedown == true)
{
if (mainMenuVariables.pictureBox == false)
{
mainMenuVariables.pictureBox = true; …Run Code Online (Sandbox Code Playgroud)