473,418 Members | 2,233 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Getting rid of the cursor?

I have a form and a multiline textbox with a message.
The problem is that I can see the cursor, is there any
way so move the focus away from the textbox so that
I don't see the cursor on the form (unless someone
actively clicks on the form, that is ok)

I tried this, but it didn't work

Public Declare Auto Function HideCaret Lib "user32.dll" ( _
ByVal hwnd As IntPtr) As Boolean
Private Sub About_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Select(1000, 0)
HideCaret(TextBox1.Handle)
End Sub

Nov 21 '05 #1
2 1443
Dinny,
By cursor I presume you really mean Caret, as a TextBox has both a Cursor &
a Caret!

Be certain to read the Win32 help on HideCaret & its companion ShowCaret.
They only work when the control itself owns the Caret. If the Form.Load
event the TextBox does not yet own the Caret. The TextBox owns the Caret
when it gets focus...

For a discussion on showing & hiding the Caret in a VB.NET application,
along with a handy Caret class, see Charles Petzold's book "Programming
Microsoft Windows with Microsoft Visual Basic .NET" from MS Press.

Hope this helps
Jay

"dinny" <nospam> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have a form and a multiline textbox with a message.
The problem is that I can see the cursor, is there any
way so move the focus away from the textbox so that
I don't see the cursor on the form (unless someone
actively clicks on the form, that is ok)

I tried this, but it didn't work

Public Declare Auto Function HideCaret Lib "user32.dll" ( _
ByVal hwnd As IntPtr) As Boolean
Private Sub About_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
TextBox1.Select(1000, 0)
HideCaret(TextBox1.Handle)
End Sub

Nov 21 '05 #2
Yes, thank you. Just needed to move it to TextBox1_GotFocus
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jay donnell | last post by:
I have a short multi-threaded script that checks web images to make sure they are still there. I get a segmentation fault everytime I run it and I can't figure out why. Writing threaded scripts is...
0
by: Golawala, Moiz M (GE Infrastructure) | last post by:
Hi All, Could someone please help me with an issue I am having. I am having problem returning values from a Stored Procedure that creates a dynamic table (table variable) inserts values during a...
15
by: middletree | last post by:
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do different things. I'm looking for "pagename.asp"
15
by: Philip Mette | last post by:
I am begginner at best so I hope someone that is better can help. I have a stored procedure that updates a view that I wrote using 2 cursors.(Kind of a Inner Loop) I wrote it this way Because I...
4
by: s99999999s2003 | last post by:
hi the database "execute" function returns a list of logical results. Each logical result is a list of row tuples, as explained in the documents. everytime i use it to execute various...
0
by: gregory_may | last post by:
I apologize for cross posting, but I don't know the best place to post this. This link is a pretty good overview of the various System Cursor routines....
10
by: scoonie999 | last post by:
I'm having a problem that I can't seem to find any solution for online. I'm using a cursor in a cobol program to fetch some data. I know for a fact that the select should return 2 rows. The...
1
by: kallol | last post by:
Hi Everyone, I have a form designed with a table and the table is inside a <div> (Required. Can’t get rid of it). The div has style “height: 100% and scrollable: auto”. The issue: In IE, let...
1
by: luigidavinci | last post by:
I am using Scriptaculous to achieve a pretty simple and straightforward effect. I need a couple of images and text to fade in and fade out periodically, which I already managed to do it using...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.