Home > DeveloperSection > Forums > C# How to Disable Cursor in Textbox?
Royce Roy
Royce Roy

Total Post:149

Posted on    November-14-2013 12:58 AM

 C# C# 

 1 Reply(s)
 9183  View(s)
Rate this:
Hi Guys

I have a read only textbox in my winform application and I want to disable the cursor. How to do it?


Pravesh Singh

Total Post:412

Posted on    November-14-2013 1:20 AM

Hi Royce,

public class ReadOnlyTextBox : TextBox



    static extern bool HideCaret(IntPtr hWnd);

    public ReadOnlyTextBox()


        this.ReadOnly = true;

        this.BackColor = Color.White;

        this.GotFocus += TextBoxGotFocus;

        this.Cursor = Cursors.Arrow; // mouse cursor like in other controls


    private void TextBoxGotFocus(object sender, EventArgs args)





Don't want to miss updates? Please click the below button!

Follow MindStick