Groups | Blog | Home
all groups > vb.net controls > june 2004 >

vb.net controls : Need to .SelectAll()



Ken Tucker [MVP]
6/28/2004 8:40:34 AM
Hi,

DirectCast(c, TextBox).SelectAll()

Ken
-------------

[quoted text, click to view]

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.6 - Release Date: 6/25/2004

Marc Miller
6/28/2004 11:24:13 AM
Hi,

Being new to VB.NET Windows Forms, I need a little help with the =
following. I need to do a SelectAll on the first textbox
that I have changed to forecolor to red. However, I get an error:

"selectall" is not a member of "Systems.Windows.Forms.Control"

Is there a workaround?


Dim c As Control
For Each c In Controls
If TypeOf c Is TextBox Then
If c.ForeColor.Name =3D "Red" Then
If MessageBox.Show("There are errors on this record.", =
"Cannot Process", MessageBoxButtons.RetryCancel, =
MessageBoxIcon.Exclamation) =3D DialogResult.Retry Then
c.Focus()
c.selectall()
Return
End If
End If
End If
Next

Thanks,
hirf-spam-me-here NO[at]SPAM gmx.at
6/28/2004 6:28:16 PM
* "Marc Miller" <mm1284@hotmail.com> scripsit:
[quoted text, click to view]

\\\
DirectCast(c, TextBox).SelectAll()
///

--
Herfried K. Wagner [MVP]
AddThis Social Bookmark Button