From: Ryan on
The line below marked with * is not valid in vb.net 2008; how do I set the
border dynamically?

Dim cControl As Control
For Each cControl In Me.Controls
If (TypeOf cControl Is TextBox) Then
cControl.BackColor = Color.White
cControl.BorderStyle=None '*****************'
End If
Next cControl
From: Armin Zingler on
Am 03.03.2010 00:36, schrieb Ryan:
> The line below marked with * is not valid in vb.net 2008; how do I set the
> border dynamically?
>
> Dim cControl As Control
> For Each cControl In Me.Controls
> If (TypeOf cControl Is TextBox) Then
> cControl.BackColor = Color.White
> cControl.BorderStyle=None '*****************'
> End If
> Next cControl


If you switch Option Strict On and do the right cast,
intellisense should offer BorderStyle.None:

DirectCast(cControl, TextBox).BorderStyle = BorderStyle.None



--
Armin
From: Ryan on
Thanks, it worked.

"Armin Zingler" wrote:

> Am 03.03.2010 00:36, schrieb Ryan:
> > The line below marked with * is not valid in vb.net 2008; how do I set the
> > border dynamically?
> >
> > Dim cControl As Control
> > For Each cControl In Me.Controls
> > If (TypeOf cControl Is TextBox) Then
> > cControl.BackColor = Color.White
> > cControl.BorderStyle=None '*****************'
> > End If
> > Next cControl
>
>
> If you switch Option Strict On and do the right cast,
> intellisense should offer BorderStyle.None:
>
> DirectCast(cControl, TextBox).BorderStyle = BorderStyle.None
>
>
>
> --
> Armin
> .
>
 | 
Pages: 1
Prev: User Controls Gets bigger
Next: Create Web Share