Runtime Class Declaration
-
The title may not be right, but I don't know how to call it. I want to know how to make a class adapt to a particular of control at run time. I am building a rich textbox control similar to the one below. http://www.codeproject.com/cs/miscctrl/richtextboxextended.asp Everything works fine, but I don't want the control to adapt to the richtextbox at the time I am building it. I want the users to choose specific textbox when they drag the component to the form. In that case, when they drag the control to the form, only the toolbar portion will show, not the text area. From the toolbar property, they can choose the richtextbox to associate the component with. I want this type of functionality, in that case the richtextobx can be located anywhere in the form. It does not have to be located right below the toolbar.
-
The title may not be right, but I don't know how to call it. I want to know how to make a class adapt to a particular of control at run time. I am building a rich textbox control similar to the one below. http://www.codeproject.com/cs/miscctrl/richtextboxextended.asp Everything works fine, but I don't want the control to adapt to the richtextbox at the time I am building it. I want the users to choose specific textbox when they drag the component to the form. In that case, when they drag the control to the form, only the toolbar portion will show, not the text area. From the toolbar property, they can choose the richtextbox to associate the component with. I want this type of functionality, in that case the richtextobx can be located anywhere in the form. It does not have to be located right below the toolbar.
I added a public value something like that
set { RichTextBox = value; }
From the control, I set the richtextbox visibility to false. I built it; it seemed to work fine. Now, when I dragged the control to the form, then dropped a richtextbox to test it. I can see a combo in the property where I can select that richtextbox name. However when I selected it, the program exited abruptly which seemed to be an exception to me. -
I added a public value something like that
set { RichTextBox = value; }
From the control, I set the richtextbox visibility to false. I built it; it seemed to work fine. Now, when I dragged the control to the form, then dropped a richtextbox to test it. I can see a combo in the property where I can select that richtextbox name. However when I selected it, the program exited abruptly which seemed to be an exception to me.I think you can debug the designer by opening up a second instance of VS and attaching the debugger to the instance you want to debug through Debug > Attach to Process, this should let you know more about the exception.