Jump to content
  • Advertisement
Sign in to follow this  
SquareDanceSteve

[.net] Public Shared PictureBox in VB.Net

This topic is 5377 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make a picturebox on a form 'shared' so i can pass it into my d3d class, from another module I have it working now, i editied the designer generated code for the picturebox i changed 'friend' to 'public shared', so it works, but when i am in the form designer window its not shown, and i have a caution thing down in the buiild error/debug window that says "the variable 'PicX' is either undeclared or was never assigned' but when i run my program it is present then when i go and edit anything on the form designed the picture box is deleated

Share this post


Link to post
Share on other sites
Advertisement
It's the Shared that kills it.

You should not change the generated code directly but change the property Modifiers in the property box of the picturebox in design mode to e.g. Public.

Shared is not an option there because it 'disconnects' the form object from the picturebox and 'connects' it to the form class.

That's why it isn't there in Design mode; Design mode uses an instance (object) of the form.

Cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!