I have several combo's on my form and want to quickly enable or disable the group. I tried the following code but it doesn't work.
Dim combo As Infragistics.Win.UltraWinEditors.UltraComboEditor
combo.Enabled = False
Next
I have the code in the formload event. When it runs it jumps out of the form load event at this line "For Each combo In Me.Controls" and goes to the splitter control_splitter moved event. from there it goes back to the .show on the previous form and I get this error:
Unable to cast object of type 'System.Windows.Forms.SplitContainer' to type 'Infragistics.Win.UltraWinEditors.UltraComboEditor'.
What am I doing wrong.
thanks
Me.Controls most likely contains many controls that are not UltraComboEditors, so this is probably raising an exception which is being caught.
What you should do it use a variable of type Control for your loop, then check each Control to see if it is an UltraComboEditor inside the loop.