User Control accessing Form?

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

User Control accessing Form?
hungryhounduk
Hey Coders
I haven't coded for years and I'm a little rusty

I have a usercontrol with a Picturebox on it and I have created a new Form called List with a Listbox on it
I want the form ( List) to show when I click the Picturebox on the UserControl.

I have spent about a day on it and keep getting the code wrong :(

any help would be great
Image
User avatar
hungryhounduk
VIP - Site Partner
VIP - Site Partner
Posts: 2870
Joined: Mon Jul 27, 2009 11:58 am

I re created the scenario using 2 forms and that worked fine,
But when using a usercontrol it throws errors
Image
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: User Control accessing Form?
CodenStuff
if the usercontrol is in the same project as the form you should be able to use

in the picturebox click event...
Code: Select all
List.Showdialog()
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
3 posts Page 1 of 1
Return to “Coding Help & Support”