473,408 Members | 1,857 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,408 software developers and data experts.

Playing Hide-the-Caret

Hi,

I'm trying to set up a richtextbox to behave like the text
area in a web browser, i.e. no caret, and a cursor that
changes depending on what it's hovering over.

I've been setting the cursor by testing the "Selection"
properties of the text the cursor is over. This requires
setting the SelectionStart property, which causes the
caret to move. Ugh!

I tried using the user32.dll hideCaret function in an
attempt to remove the caret. This works inconsistently,
even when I place hideCaret calls all over the place.
Grrrr!

Is there an elegant solution to removing the caret?
Perhaps if I could control the caret color...

Any suggestions?

Randy
Nov 20 '05 #1
2 2873
This may help, I have not tested it on VB.NET

http://www.vb-helper.com/HowTo/nocaret.zip

Uses the HideCaret API function. Unfortunately, Visual Basic restores the
caret frequently. Subclass and hide the caret whenever the TextBox gets
message WM_PAINT or &H100E (whatever that is).

Regards - OHM

randy wrote:
Hi,

I'm trying to set up a richtextbox to behave like the text
area in a web browser, i.e. no caret, and a cursor that
changes depending on what it's hovering over.

I've been setting the cursor by testing the "Selection"
properties of the text the cursor is over. This requires
setting the SelectionStart property, which causes the
caret to move. Ugh!

I tried using the user32.dll hideCaret function in an
attempt to remove the caret. This works inconsistently,
even when I place hideCaret calls all over the place.
Grrrr!

Is there an elegant solution to removing the caret?
Perhaps if I could control the caret color...

Any suggestions?

Randy


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #2
Ugh. What a mess.

I couldn't get this to work.

Thanks anyway...

Randy
-----Original Message-----
This may help, I have not tested it on VB.NET

http://www.vb-helper.com/HowTo/nocaret.zip

Uses the HideCaret API function. Unfortunately, Visual Basic restores thecaret frequently. Subclass and hide the caret whenever the TextBox getsmessage WM_PAINT or &H100E (whatever that is).

Regards - OHM

randy wrote:
Hi,

I'm trying to set up a richtextbox to behave like the text area in a web browser, i.e. no caret, and a cursor that
changes depending on what it's hovering over.

I've been setting the cursor by testing the "Selection"
properties of the text the cursor is over. This requires setting the SelectionStart property, which causes the
caret to move. Ugh!

I tried using the user32.dll hideCaret function in an
attempt to remove the caret. This works inconsistently,
even when I place hideCaret calls all over the place.
Grrrr!

Is there an elegant solution to removing the caret?
Perhaps if I could control the caret color...

Any suggestions?

Randy


Regards - OHM# On**********@BTInternet.com
.

Nov 20 '05 #3

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

Similar topics

4
by: Atz | last post by:
<a href="" onmousedown="setTimeout('status=\'Hide\'',5000)" onmouseover="window.status='Hide'; return true"> send link </a> I use this for hidding link path in status bar. This is working fine...
4
by: SpamProof | last post by:
I need to set my div tag (<div id="divBioBottom"> content </div>) to either visible or hidden from javascript. Does anyone know how to do this? Thanks. 7078895 /ra
12
by: Jochen Daum | last post by:
Hi! I have a dynamically generated page (PHP), which contains an Explorer like view of items. I would like to hide multiple <tr>'s by name, but I can't figure out how thats done. I have this...
2
by: Frances Del Rio | last post by:
pls how do I detect if .swf movie is playing or has stopped? .swf is in a pop-up, I would like to trigger a window.close() once Flash movie has stopped playing.. (pls don't lecture me about...
2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
1
by: Chris Kettenbach | last post by:
Good morning all, Any ideas for an easy function to show/hide a DIV element? I have two drop down lists on a page. I have two div elements I want to show and hide. If you select "other" in...
2
by: MAF | last post by:
How do I hide a tabpage of a given tab control? //Disable other tabs until item is saved this.tabPage2.Hide(); //this doesn't work this.tabPage3.Hide(); this.tabPage4.Hide();
3
by: sivaraman.S | last post by:
Hi friends, How to hide a column in datagrid. regards, Sivaraman.S
5
by: dbuchanan | last post by:
Is it possible to detect the SQLS2K column level permission for the logged in user. I want to be able to hide a control or Button based on user permission to edit that column. Can anyone...
5
by: xrado | last post by:
when i say window.hide(), window dont hide imidetly i want to hide it for a few seconds, do something and then show it back how can i do this? i have this example: import pygtk,time...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.