473,657 Members | 2,592 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selection highlight visible for inactive control

GaryTexmo
1,501 Recognized Expert Top Contributor
This is driving me nuts, I can't find anything after numerous web searches, I'm hoping someone here has some insight. What I'd like is for the selected text on a control (rich text box in this case) to remain highlighted when the control is inactive.

To see an example of what I want, simply open notepad, type some things, select what you typed, then click another window. The text will remain highlighted even though notepad is inactive.

To see an example of what I don't want, create your own form in Visual Studio and put a multiline text box (or rich text box, doesn't seem to matter) on it. Run your app and type some things in the text box, then highlight it and leave focus on the form. The highlight magically disappears.

Any help would be greatly appreciated!
Jul 16 '09 #1
2 2686
cloud255
427 Recognized Expert Contributor
Hi

There is a property called 'HideSelection' exposed by the RichTextBox control. Simply set this property to false and you will have the desired effect.
Jul 17 '09 #2
GaryTexmo
1,501 Recognized Expert Top Contributor
That's exactly it, thank you! And now that you've pointed it out, it's painfully obvious... it's there for both a rich text box and a text box.

...can't find the forest for the trees...

Thank you again!
Jul 17 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3570
by: Mark | last post by:
How can I turn the selection highlight off when I enter a textbox? I tried setting SelLength to 0 but it still selected 1 character. Can I change the color of the selection highlight? I want to turn the backcolor of a textbox to blue in the OnEnter event but the selection highlight interferes with what I want to do. Thanks! Mark
3
3436
by: JingleBEV | last post by:
Hi all, I have a masked text control that would return a date in string format via the mask property like: "9/23/2004" and i have a calendar control that would pop up when I click a command button, I know the masked text control always returns a valid date. How do I code in the command click to highlight the correct date on calendar control?
2
2147
by: ___Newbie___ | last post by:
Hello, I'm looking for a control that can display rows and columns similar to a table but highlight the entire row during selection? Listbox highlights the entire row but doesn't support multiple columns. DataGrid on the other hand supports multiple columns but I can't able to highlight the entire row. It does a column and row level highlighting. Does anybody know other options? Thanks.
2
1997
by: parm | last post by:
How do I highlight text in my first (tabindex = 1) asp control (eg: textbox) on the webform on page load. If I try to set focus using javascript then I get script error "Cannot move focus to invisible control)". Because the tabindex of first control is 1 therfore I can get the focus on first control but the text inside is not highlighted. Any help would be greatly appriciated. My set focus javascript: Public Sub SetFocus(ByRef MyPage As...
11
1834
by: Xah Lee | last post by:
Of interest: • The Semicolon Wars, by Brian Hayes. 2006. http://www.americanscientist.org/template/AssetDetail/assetid/51982 in conjunction to this article, i recommend: • Software Needs Philosophers, by Steve Yegge, 2006 http://xahlee.org/Periodic_dosage_dir/_p/software_phil.html
2
18094
by: Bruce Stradling | last post by:
I would like to have two tables. One I call SystemPropertyTypeTable which contains the defaults and the other UserPropertyTypeTable. Each has 3 fields. PropertyType, Description, Status. The idea here is to allow a user to change his/her defaults or to add a new Property Type without messing with the system default list. I would like to Merge these two tables using the following logic. The SystemPropertyTypeTable any records that...
0
1296
by: Franky | last post by:
I have a MDI form open and two child forms open in it. Each of the children contains a usercontrol which contains a richtextbox. The topmost form's caption bar is highlighted but I click on the other form's usercontrol, which is partially showing. (I don't click the caption bar, if I did it would become highlighted, but clicking the usercontrol does not highlight the caption bar.)
2
3985
by: Angus | last post by:
I am trying to change the selection in Javascript - but this HTML element is not a standard option control. On the web page it looks like a dropdown list - and you click on the right hand down arrow and you see the entries in a dropdown. But how would I control this thing from javascript? Here is the HTML: <div class="selection" style="top:0; left:89; width:159; height:21;"
0
1062
by: Tom Van Hauwaert | last post by:
I designed a font "WAG Symbols" that contains symbols in the private use area of unicode. Now I want to develop an insertable object that can handle these characters so they become visible in, let's say MS Word. In Word, when the control is active, the unicdoe characters are displayed as should. When the control is inactive, the private use area characters are all replaced by ? In the ActiveX Control Test Container this behaviour occurs...
0
8425
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
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
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...
1
8522
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8622
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
7355
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...
0
5647
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();...
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1736
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.