Search code examples
c#mouse-cursor

c# change pointer on mouse enter


I know the question is very general but, still,I don't get the cross arrow like I need when the pointer is over the textbox,

the following code is my function to fullfil what I need

private void textBox1_MouseEnter(object sender, EventArgs e)
    {
        textBox1.Cursor = Cursors.Cross;
    }

and some how, it doesn't work.

what component do I need to check to make the pointer changed correctly ?

is there any missing components or reference to my computer ? I have tried to another pointer (Help pointer) and still not working,

update current code :

 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Image_Processor
{
    public partial class Form1 : Form
    {

        Validator val = new Validator();

        public Form1()
        {
            InitializeComponent();
            val.isValidateFree();
            this.Text = identitas.judul_App;
            textBox1.Cursor = Cursors.Help;
        }

        private void textBox1_MouseEnter(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.Help;
        }
    }
}

still not working


Solution

  • Events like MouseEnter will not be triggered if the control.Enable = false