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

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 10209
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.SelectionLength = 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
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...
1
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...
4
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!...
5
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...
5
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. ...
11
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...
14
by: > Adrian | last post by:
Is there a way of stopping text from highlighting in textbox? Many thanks, Adrian.
2
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...
7
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.