Set Textbox BorderStyle to None Dynamically in 2008

  • Thread starter Thread starter Ryan
  • Start date Start date
R

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
 
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
 
Thanks, it worked.

Armin Zingler said:
Am 03.03.2010 00:36, schrieb Ryan:


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

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