Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I pass a structure to a control?

Status
Not open for further replies.

eward1

Programmer
Feb 24, 2003
18
US
In VB.NET I have created a control. One of its Properties I have defined WriteOnly and it takes a structure. I have created the identical structure in my application. When I try to set that Property from my application I get the following error:
Cannot convert App.Structr to Ctl.Structr
Even though both structures are the same, they don't know about each other.
 
I'm not sure if this can be done but try declaring the structure in the control as public and then instead of declaring it again in the application call the structure directly from the control. e.g.

Dim mystrct as new ctl.strct

If that doesn't work try taking it out of the control completely and making the structure it's own dll and including the dll in both the .ocx project and the application project. This should then work

Mark

The key to immortality is to make a big impression in this life!!
 
Thanks Spellman,

Your first suggestion worked great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top