Why is it that some components / controls will not be inherited in the form of a child if they are the friend of the access moderator For example, when they are declared with preserved, for example, I have found a dataset object in my parent form which is "Friend" (I pulled and pulled it out on the form , So it's a nicer in the designer scene As shown in the form of mechanism), but I saw that my child form was not inherited as required, once I changed it to "protected", it was shown as my child in the expected form.
I know that the protected child form allows to modify the inherited control, but how does this really matter I have described above?
It depends on the assembly in which the base form is declared if it is another Compared to the assembly in that derivative form, the friend can not work. The declared members of the members are only accessible within the Legislative Assembly.
The proper access modifier here is protected. This ensures that it does not matter which form the derivative form is declared, and it ensures that only the derived form classes can use the dataset.
Comments
Post a Comment