473,503 Members | 10,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

keeping highlighted text visible in a form that does not have focus

Hey,

Here is a quick question: I have two forms that I am using, and I need
to highlight the text in Form1 by clicking and dragging (obviously).
So, when I switch to Form2 (making it the focused form), I want to
still be able to see the highlighted text in Form1 even though the form
is not focused. When I click back to Form1, I see the highlighted text,
but if I focus Form2, I don't see the highlighted text. Is there a way
that I can change this? I've googled to no avail =(
Thanks so much!

Jul 28 '06 #1
3 2009
"njuneardave" wrote:
Here is a quick question: I have two forms that I am using, and I need
to highlight the text in Form1 by clicking and dragging (obviously).
So, when I switch to Form2 (making it the focused form), I want to
still be able to see the highlighted text in Form1 even though the form
is not focused. When I click back to Form1, I see the highlighted text,
but if I focus Form2, I don't see the highlighted text. Is there a way
that I can change this? I've googled to no avail =(
You didn't specify, but I'm assuming the highlighted text is in a TextBox?
If so, set the TextBox's HideSelection property to false.

--
Timm Martin
Mini-Tools
..NET Components and Windows Software
http://www.mini-tools.com

Jul 28 '06 #2
hey, thanks for the reply! I'm sorry about not specifying, but I am
using an RTB. You hit the nail on the head. Thanks so much for your
help!!!!
Mini-Tools Timm wrote:
"njuneardave" wrote:
Here is a quick question: I have two forms that I am using, and I need
to highlight the text in Form1 by clicking and dragging (obviously).
So, when I switch to Form2 (making it the focused form), I want to
still be able to see the highlighted text in Form1 even though the form
is not focused. When I click back to Form1, I see the highlighted text,
but if I focus Form2, I don't see the highlighted text. Is there a way
that I can change this? I've googled to no avail =(

You didn't specify, but I'm assuming the highlighted text is in a TextBox?
If so, set the TextBox's HideSelection property to false.

--
Timm Martin
Mini-Tools
.NET Components and Windows Software
http://www.mini-tools.com
Jul 28 '06 #3
Hi Dave,

The same HideSelection Property can be applied for RichTextBox as well.

You can use:

Expand|Select|Wrap|Line Numbers
  1. yourRTB.HideSelection  = false;
  2.  
to keep the selected text remains highlighted even the rtb loses focus.

HTH.
Hugh Van.
njuneardave wrote:
hey, thanks for the reply! I'm sorry about not specifying, but I am
using an RTB. You hit the nail on the head. Thanks so much for your
help!!!!
Mini-Tools Timm wrote:
"njuneardave" wrote:
Here is a quick question: I have two forms that I am using, and I need
to highlight the text in Form1 by clicking and dragging (obviously).
So, when I switch to Form2 (making it the focused form), I want to
still be able to see the highlighted text in Form1 even though the form
is not focused. When I click back to Form1, I see the highlighted text,
but if I focus Form2, I don't see the highlighted text. Is there a way
that I can change this? I've googled to no avail =(
You didn't specify, but I'm assuming the highlighted text is in a TextBox?
If so, set the TextBox's HideSelection property to false.

--
Timm Martin
Mini-Tools
.NET Components and Windows Software
http://www.mini-tools.com
Jul 30 '06 #4

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

Similar topics

5
5530
by: Lyn | last post by:
Hi, I have a form which contains a number of subforms in different pages of a tab control. In the detail section of each subform, I list records related to the main form record, but from...
1
1468
by: Jack | last post by:
Hello, On a form, I have a tab control with two tab pages. On one tab page, I have about seven group boxes which I hide and make visible when buttons are clicked on the tab page. No problems...
6
13789
by: laredotornado | last post by:
Hello, Assuming I have the functions, "isNumber" and "isEmpty", how would I write the HTML INPUT type="text" element such that a person cannot exit the element unless they have typed in a valid...
3
2590
by: papalarge | last post by:
I have a VB.NET application that consists of a toolbar and a subwindow that I want to function together and not independently. So when I give focus to one, I want to make sure that the other is...
1
5785
by: dana1 | last post by:
I have a form with several combo boxes in the header used to determine the records that will be displayed on the form. When I tab or enter from the last combo box in the header, I want the focus to...
2
13387
by: bg_ie | last post by:
Hi, I have a treeview where the user selects a node before editing it. The problem is that when the user clicks on the text box to edit the node, the treeview loses its focus and the node is no...
2
1498
by: Annath | last post by:
I know this is normal operation for the C# TextBox control, but it will not show highlighted text as being highlighted until focus is given to that particular control. I was wondering, is it possible...
6
5651
by: Rich Raffenetti | last post by:
I have a form with a listview control and a textbox. When I change focus from the listview to the textbox, the highlighted item on the listview loses the highlight. That is not the behavior I...
4
6012
by: pablorp80 | last post by:
Hello, Here is what I need: I need the focus and the cursor set to a textbox named txtGT, every time no matter if it is the first page load or whether it is a postback. Here is the problem: I...
0
7194
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
7070
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
7316
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
5566
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
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
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 ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
372
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...

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.