H
hans.werner
hi,
I have a little problem with a custom control and for each
(number is an integer)
(the control names are AxCTC1 etc
Dim ctrCTI As AxCTCLib.AxCtc
For Each ctrCTI In Me.Controls <---- error here
Dim indxCTI As String = ctrCTI.Name
If indxCTI = "AxCtc" & number Then
ctrCTI.AssignDevice = number
End If
Next
if i do this it brings up an error in For Each etc.
'System.InvalidCastException'
the conversion is not possible
i dunno what I should write "me.controls" is not allowed for that
control i think. it works for textboxes or anything else. the strange
thing is when i do dim ctrCTI as control it shows up. but in this case
" ctrCTI.AssignDevice = number" doesnt work anymore because its a
special value of this control and not a default ms control .
thanks for help
I have a little problem with a custom control and for each
(number is an integer)
(the control names are AxCTC1 etc
Dim ctrCTI As AxCTCLib.AxCtc
For Each ctrCTI In Me.Controls <---- error here
Dim indxCTI As String = ctrCTI.Name
If indxCTI = "AxCtc" & number Then
ctrCTI.AssignDevice = number
End If
Next
if i do this it brings up an error in For Each etc.
'System.InvalidCastException'
the conversion is not possible
i dunno what I should write "me.controls" is not allowed for that
control i think. it works for textboxes or anything else. the strange
thing is when i do dim ctrCTI as control it shows up. but in this case
" ctrCTI.AssignDevice = number" doesnt work anymore because its a
special value of this control and not a default ms control .
thanks for help