vendredi 3 avril 2015

Make a Form Oledb Connection available as a design time property of a User Control

I have a set of User Controls in a separate project in a vb.net solution. One User Control type needs access to the Form's data connection. The Form is in a project that has a reference to the User Control project. I am able to create instances of that User Control on the form. I would like the User Control instance on the form, at design time, to be able to set its Connection property to a public Connection field or property that has been set in the form. In the properties window of UserControl1 on the form, only "(none)" shows as available for the Connection property. I have tried setting an attribute on the User Control Connection property -- System.ComponentModel.Browsable(True). That did not make the form Connection available. Is there a way to make the form's Connection (and other object properties) available in the User Control's properties window? I am using vb.net 3.5.


Aucun commentaire:

Enregistrer un commentaire