UserControl problem
Hi, as you can see, i created a new UserControl but when i try to drag it on my form it shows some errors, how can i make it work ? Apparently it's not because of the code himself, because i can add one manually in my flowLayoutPanel, but i cannot drag it from the toolbox without an error
14 Replies
Would be really nice, if you can roughly translate this error 😄
But some information: If you drag your UserControl onto a form, the Constructor of that control is called. So maybe you have some stuff happening in your constructor
here is the code of the UserControl
and the error is : "Impossible to create componant 'listCompetItem' the error message is :" and all the paths following
So your constructor contains
InitializeButtons()
. And in there, you are loading a bunch of different images from some paths, where the root is your StartupPath. I suppose those paths are just not found.
It's better to use the images as resources in your app and then just refer to those resourceshow ? i tried to add but its empty
nevermind i found
it still doesn't work :c
So what's wrong?
i have this error now, not the same but i still don't know what it referes to
Did you do something with the constructor perhaps?
oh i just changed something and it worked
in the constructor i added a variable linked to Parent of the control but somehow it compiled without telling me that on the load it doesn't have parent