473,721 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TextBox Selection/Highlight

How to turn it off?

For example, this code
TextBox1.Text = "hello";
puts "hello" in the TextBox, but
it is highlighted. I want to turn off
the highlighting.

I have looked at every TextBox design property.

The TextBox is used for debug program output.
Highlighting is hard to read.

Thanks,
--
Jeff Bangert
University of Kansas
Nov 16 '05 #1
4 10237
Change the focus to another control on the form, either at the start or
after you add the text.

You could alternatively change the fonts/colors or use a label control
instead.

Lowell

Jeff Bangert wrote:
How to turn it off?

For example, this code
TextBox1.Text = "hello";
puts "hello" in the TextBox, but
it is highlighted. I want to turn off
the highlighting.

I have looked at every TextBox design property.

The TextBox is used for debug program output.
Highlighting is hard to read.

Thanks,

Nov 16 '05 #2
Have you tried

textBox1.Select ionLength = 0;

Nov 16 '05 #3
Lowell, thanks for the quick reply.

I'll take things one at a time. By the way,
I'm running C# Express 2005 Beta.

"Change the focus to another control on the form"

There is no other control on the form, only the TextBox
that I'm using for debug output. Other than that, I just
draw lines on an empty part of the form.

I tried adding a button. If run the program and click
on the button, TextBox is no longer highlighted.

But, I don't seem to know how to change focus in code.
Tried

TextBox = "hello";
button1.Focus() ;

did not work.

More later.

Thanks,
"Lowell Heddings" wrote:
Change the focus to another control on the form, either at the start or
after you add the text.

You could alternatively change the fonts/colors or use a label control
instead.

Lowell

Jeff Bangert wrote:
How to turn it off?

For example, this code
TextBox1.Text = "hello";
puts "hello" in the TextBox, but
it is highlighted. I want to turn off
the highlighting.

I have looked at every TextBox design property.

The TextBox is used for debug program output.
Highlighting is hard to read.

Thanks,

Nov 16 '05 #4
Solved my own problem:

enabled = false

"Jeff Bangert" wrote:
How to turn it off?

For example, this code
TextBox1.Text = "hello";
puts "hello" in the TextBox, but
it is highlighted. I want to turn off
the highlighting.

I have looked at every TextBox design property.

The TextBox is used for debug program output.
Highlighting is hard to read.

Thanks,
--
Jeff Bangert
University of Kansas

Nov 16 '05 #5

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

Similar topics

4
3572
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
1
1822
by: VMI | last post by:
I have two textbox controls and I want my application to automatically highlight in the second textbox control the same amount of chars (and the same position) that are being highlighted in the first textbox. For example, if textbox1 has string "File is open" and textbox2 has "File is closed", and I highlight 'open' in textbox1, textbox2 should automatically highlight "close". Is this possible? Thanks.
4
3161
by: melanieab | last post by:
Hi, I need to write something so that when a textbox is entered (this is for a touchscreen), all the text in that textbox is selected (highlighted) and new keystrokes replace the old text. Help! Thanks (again), Melanie
5
7312
by: marfi95 | last post by:
I'm very confused. I'm trying to automatically select the text when my textbox gets the focus. This is typically when the user has clicked the mouse in the field. This is the code I have in the Text1_GotFocus event: Text1.SelectionStart = 0 Text1.SelectionLength = Text1.Text.Length However, the text does not get highlighted. It appears to be the
5
1939
by: kusanagihk | last post by:
To all, I've got a problem using Javascript to control the properties of a html textbox. I was wondering if I could change the cursor index / position of the text within a textbox object. ie. for example the text of a textbox is "hello tom"; and I want to shift the cursor's index to 6 which points at the letter "t" of the word "tom"
11
1842
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
14
13402
by: > Adrian | last post by:
Is there a way of stopping text from highlighting in textbox? Many thanks, Adrian.
2
2361
by: JJ | last post by:
I have a textbox that is used to insert some html code. I want to highlight errors in the code, possibly by selecting the text. Is it possible to highlight/select areas of a textbox programmatically? Thanks, JJ
7
15073
by: sphinney | last post by:
I have a datasheet style form with textbox (MyTextBox) that has the Text Format property set to "Rich Text". It is bound to a memo field in a table. How do I change the text or highlight color of certain text in the textbox such that the formating is saved in an underlying memo field? My situation is a little different than other posts I read. Most posts show how to find and select certain text in a textbox, and then change the formating...
0
9367
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
9215
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9131
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
9064
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...
1
6669
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
5981
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();...
0
4484
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2130
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.