RockyT69

I would like to disable the blinking cursor from my textbox whenever it gets the focus.



Re: Windows Forms Designer Remove Disable Textbox blinking cursor

BlueMikey

There is some code in there that shows how to do it. It looks like you have to do it through API calls and you have to make those calls pretty frequently.

http://msdn2.microsoft.com/en-us/library/ms648398.aspx





Re: Windows Forms Designer Remove Disable Textbox blinking cursor

RockyT69

I fixed the problem by on the mousedown event of the textbox i set the focus to a buton

so the cursor never shows up

Thanks





Re: Windows Forms Designer Remove Disable Textbox blinking cursor

BlueMikey

So you never want the user to type in it

You can also still reach it by tabbing there.




Re: Windows Forms Designer Remove Disable Textbox blinking cursor

R.A

the best way is:

Public Class MyTextBox

Inherits TextBox

<DllImport("user32.dll", EntryPoint:="HideCaret")> Public Shared Function HideCaret(ByVal hwnd As IntPtr) As Boolean

End Function

Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)

MyBase.WndProc(m)

HideCaret(Me.Handle)

End Sub

End Class