Thanks, the code is as follows:
You need to make this declaration in order to use the P/Invoke Layer
// P/Invoke to hide caret
[DllImport ( "User32.dll" )]
static extern Boolean HideCaret ( System.IntPtr hWnd );
All that remains then is to call the function like so from your method:
HideCaret ( tbConsole.Handle );
Do not forget the following using clause, otherwise you get a compile-time
error:
using System.Runtime.InteropServices;
By the way, thanks very much for the answer.
Regards
Joseph.
"Nicholas Paldino [.NET/C# MVP]" wrote:
J,
You should be able to call the HideCaret API function through the
P/Invoke layer, passing the handle to the textbox.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"MalteseFalcon" <Ma***********@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com... Hello
I am trying to remove the caret (i.e. the blinking bar) from a textbox.
Anyone knows the trick to do this please?
Thanks and Regards
J
--
Before God we are equally wise and equally foolish.
-- Albert Einstein