|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Me.Controls CheckStateHi,
I'm using a counter to iterate through the CheckBox controls on my form to set properties. For i = 1 To 48 Me.Controls("X" & i.ToString).Enabled = False Next My question is; why can't I set the CheckState in this way like For i = 1 To 48 Me.Controls("X" & i.ToString).CheckState = CheckState.Checked Next Thanks. Your application doesn't know what type of control it is looking at.
You need to do this: For i = 1 To 48 CType(Me.Controls("X" & i.ToString), CheckBox).CheckState = CheckState.Checked Next aarrgghh***@hotmail.com wrote: Show quoteHide quote > Hi, > > I'm using a counter to iterate through the CheckBox controls on my form > to set properties. > > For i = 1 To 48 > Me.Controls("X" & i.ToString).Enabled = False > Next > > My question is; why can't I set the CheckState in this way like > > For i = 1 To 48 > Me.Controls("X" & i.ToString).CheckState = > CheckState.Checked > Next > > Thanks. Thank you.
rzale***@gmail.com wrote: Show quoteHide quote > Your application doesn't know what type of control it is looking at. > You need to do this: > > For i = 1 To 48 > CType(Me.Controls("X" & i.ToString), CheckBox).CheckState > = CheckState.Checked > Next > > aarrgghh***@hotmail.com wrote: > > Hi, > > > > I'm using a counter to iterate through the CheckBox controls on my form > > to set properties. > > > > For i = 1 To 48 > > Me.Controls("X" & i.ToString).Enabled = False > > Next > > > > My question is; why can't I set the CheckState in this way like > > > > For i = 1 To 48 > > Me.Controls("X" & i.ToString).CheckState = > > CheckState.Checked > > Next > > > > Thanks.
Combining a date value with a time value
rotating image vbCrLf Get value from nested class using reflection Want to know the power-2 based numbers of x Program Flow String Comparision error Single Sign On / Authentication System? ASP.NET 2.0 won't let me put my user controls in the same directory as Web.config |
|||||||||||||||||||||||