i got problem ...i don't want highlighting i'm using gdi ...how do i et
get ridded of unwanted highlighting?
Dim txthelp As New TextBox
With txthelp
.Parent = Me
.SelectionStart = 0
.SelectionLength = .Text.Length
.BackColor = Color.White
.Dock = DockStyle.Fill
.WordWrap = True
.Multiline = True
.ScrollBars = ScrollBars.Vertical
.ReadOnly = True
.Text = "How to play MasterMind game." & vbCrLf & _
"The object of this game is to guess the sequence of four (4) coloured
pegs the computer has selected at random from the circled colours on the
right side field. " & vbCrLf & vbCrLf & _
"The computer chooses a secret combination of coloured pegs and can use
a colours more than once in the combination." & vbCrLf & _
"The computer pegs are hidden behind logo." & vbCrLf & vbCrLf & _
"You can have up to ten (10) guesses." & vbCrLf & _
"There are up to eight (8) Coloured pegs."
end with
regards
Ken Tucker [MVP] wrote:
Hi,
The textbox will not show the selection when textbox doesnt have
focus unless you set the hideselection property to true.
http://msdn.microsoft.com/library/de...ctiontopic.asp
Ken
---------------
<ma*****@yahoo.com> wrote in message
news:nq********************************@4ax.com.. .
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
"selectedtext" though because immediately after that I have a
Console.Writeline call printing text1.selectedtext and it is the
entire field. I just can't get it to highlight. Any ideas ????
Mark