Hi There,
I had made a Form Generator AddIn with EnvDte. Its all working well
generating TextBox, CheckBox, ComboBox, etc, etc. Now I want the
generator to make my forms using my UserControls that is simply
Inherited from TextBox, CheckBox, with some plus properties and
methods.
Problem is: After i create the controls on the form via
CreateComponent, i want to reference the object in a variable of the
same type to complete all the other properties. Here is some code:
Dim objCheckComp As System.ComponentModel.IComponent
objCheckComp = objHost.CreateComponent(objHost.GetType("Friendshi p.fsCheckBox,Friendship"),
"chk" & strFieldName)
Call PropSet(objCheckComp, "Parent", objPanelComp)
Dim objCheck As Friendship.fsCheckBox
objCheck = objPanel.Controls(objPanel.Controls.Count - 1) --- In This
Line I Got The Exception ---
And the worst part is that if i stop before that line with a
breakpoint and copy the line to the immediate pane and just execute
it,
it work perfect. Then i skip the line on the code hit F5 and the
everting works fine including using that 'Immediate Created Object'.
Any help please, this driving me crazy
LC