Hi, all i have to make an application in which there is requirement to hide a cursor when a event is generated and cursor enters a panel, and if the mouse is clicked in the panel, the cursor has to be show again. But i am unable to do this. any help would be appreciated, thanks in advance.:)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace CursorHide
{
public partial class Form1 : Form
{
private bool flag;
public Form1()
{
InitializeComponent();
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
flag = false;
Cursor.Show();
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (flag)
Cursor.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
flag = true;
}
}
}