Prev: User Controls Gets bigger
Next: Create Web Share
From: Ryan on 2 Mar 2010 18:36 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 2 Mar 2010 18:56 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 2 Mar 2010 19:43 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 |