![]() |
| ||
| Access to a master form, from a component class Hello, I create a component class in Visual Studio 2008 in a windows form application. This component has a property named "MasterFormName", which should contain name of the form that component will place on it. I want that the MasterFormName property be a read only property and when I dragging it to my form at design time, it automatically take the master form name that contains the component, without directly writing by user. How could I achieve this ability? I think that I should found a way to access any master form from the component class, But how do this? Regards… |
| ||
| Re: Access to a master form, from a component class Hi You can use the ParentForm property of your component easily. For example: this.MasterFormName = this.ParentForm.Name; |
| ||
| Re: Access to a master form, from a component class Hint: If you drag your component on to another control (any thing else a Form) you will recieve a null exception error. |
| All times are GMT -4. The time now is 7:39 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC