c#改变鼠标输入时的指针

时间:2015-01-13 14:22:20

标签: c# pointers cursor

我知道这个问题非常普遍但是,当指针悬停在文本框上时,我仍然没有得到我需要的十字箭头,

以下代码是我的功能,以满足我的需要

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

以及一些如何,它不起作用。

我需要检查哪个组件才能正确更改指针?

我的电脑是否有任何遗漏的组件或参考? 我试过另一个指针(帮助指针)但仍无法正常工作,

更新当前代码:

 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;
        }
    }
}

仍然无法正常工作

2 个答案:

答案 0 :(得分:1)

如果control.Enable = false

,则不会触发MouseEnter等事件

答案 1 :(得分:0)

你有其他代码来改变该对象的光标吗?因为我无法重现你的问题。

相关问题