[RESOLVED] c# component class help please
Hi all,
i am working on a project that i need to create a component class for my project and i want to be able to reach the project from the component class. Furthermore when i drag the component onto the form from the toolbox, i want it to be visible on the form like form controls (buttons, textboxes etc. ) and i want to reach the controls of the parent form which the component added, keeping the parent form's controls private. I used IExtenderProvider interface to reach the parent form's controls but it is not possible at runtime.
Is there a good way to manage this or would you recommend something better?
Any help would be appreciated.
Re: c# component class help please
Quote:
Originally Posted by izzetbaysal
Hi all,
i am working on a project that i need to create a component class for my project and i want to be able to reach the project from the component class.
What do you mean with 'reach' If you design a component it can have an owner or parent property so you always can have access from your control to the form where it is placed. You can have different events or delegates, interfaces whatever to establish the comm between your control and the project where it is used. You also can use reflection if needed, so whats eactly the problem you have ?
Never designed a component in before ?
The article series in the bottom of my signature shows how to design controls / components based on the example of dockable panels.
Its written for beginners who have never designed any control in before. Shows lots of techniques including hooking, Typeconverter and others. if interested you can go through that stuff. Full code after each article included. Lots of pictures.
Re: c# component class help please
Quote:
Originally Posted by JonnyPoet
What do you mean with 'reach' If you design a component it can have an owner or parent property so you always can have access from your control to the form where it is placed. You can have different events or delegates, interfaces whatever to establish the comm between your control and the project where it is used. You also can use reflection if needed, so whats eactly the problem you have ?
Never designed a component in before ?
The article series in the bottom of my signature shows how to design controls / components based on the example of dockable panels.
Its written for beginners who have never designed any control in before. Shows lots of techniques including hooking, Typeconverter and others. if interested you can go through that stuff. Full code after each article included. Lots of pictures.
First of all thanks for your reply JonnyPoet. My main problem here is creating a component class to communicate between 2 projects. I mean my component class will have a parent form and a child project that the component i created will consist of the configuration of the child project. Because i didn't create the child project as a component(i need to use the child project as a component because i will use it in several forms) and i need to know if i can use the child project as a component by using only a component class.
Regards.
Re: c# component class help please
Quote:
Originally Posted by izzetbaysal
First of all thanks for your reply JonnyPoet. My main problem here is creating a component class to communicate between 2 projects. I mean my component class will have a parent form and a child project that the component i created will consist of the configuration of the child project. Because i didn't create the child project as a component(i need to use the child project as a component because i will use it in several forms) and i need to know if i can use the child project as a component by using only a component class.
Regards.
If you create a component, you can use it on a form and it can do whatever the component does for you. But I wouldn't name this a child project. Its a WindowsControplLibrary project and it is separated from your other project as it needs to work with any project where you are using it. You can see all this as mentioned before in my article series about dockable panels. The links are in my signature
Re: c# component class help please
Quote:
Originally Posted by JonnyPoet
If you create a component, you can use it on a form and it can do whatever the component does for you. But I wouldn't name this a child project. Its a WindowsControplLibrary projectand it is separated from your other project as it needs to work with any project where you are using it. You can see all this as mentioned before in my artoicle series about dockable panels. The links are in my signature
Thanks for helping JonnyPoet, i got the idea :)