• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 713 Replies
    2021 Replies
  • 331 Replies
    1928 Replies
The site is still being updated (as of 20th Jan 2018 5PM GMT) but can be used in the meantime.

User Control accessing Form?

Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
User avatar
hungryhounduk
VIP - Site Partner
Posts: 2870

User Control accessing Form?

Thu Jan 11, 2018 10:52 am

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
Posts: 2870

Re: User Control accessing Form?

Thu Jan 11, 2018 12:58 pm

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
Posts: 4350

Re: User Control accessing Form?

Sun Jan 14, 2018 8:48 pm

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.

Post Reply

Return to “Coding Help & Support”