473,830 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2908
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**********@BT Internet.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**********@BT Internet.com
.

Nov 20 '05 #3

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

Similar topics

4
18860
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 but if u click "fast" many times on same link you can easy read path link and variables. I try to change timeout time but no effect. Is there a better way to hide/encrypt this, without to removing status bar.
4
55381
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
11946
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 code to hide one element by id if (document.getElementById(id)){ document.getElementById(id).style.position = 'relative';
2
2562
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 pop-ups; this is for a client....;) thank you.. Frances
2
12194
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 { display: none; }
1
6102
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 dropdownlist 1 I want to show hidden DIV 1, or if the user selects "other" in dropdownlist 2 I want to show hidden DIV 2. And vice versa, if "other" is not selected, I want to show the relevant div. I can do this with two different function, but i...
2
3201
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
1714
by: sivaraman.S | last post by:
Hi friends, How to hide a column in datagrid. regards, Sivaraman.S
5
1519
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 direct me to example code for this? Thank you, Doug
5
8974
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 pygtk.require('2.0') import gtk
0
9793
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10774
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10202
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9314
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7746
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6950
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.