"the path is not of a legal form" error

Hi,

I made a control, and when I try to add it to a form, it shows me the error "the path is not of a legal form".

How can I solve it

Thanks.



Answer this question

"the path is not of a legal form" error

  • voidstar

    if (!this.DesignMode) {
    // Do stuff with paths...
    }



  • awj100

    Anyone Please!!
  • brother14th

    The project itself works great. The problem is just in the specific UserControl. I can run the project without any errors, I just can't add to a form that UserControl.
  • Davidjr1

    What test I didn't understand..
  • rileyt

    I tried, but I get the same error..

    Anyone


  • Suresh S

    can you give us more detail than that any code Where does the error come from how did you make the control

  • Jeyaraj N

    Didn't anyone have this problem Please, I need it today!!


  • Shadowz O Death

    But I didn't add any other reference especially for it, so it shouldn't be a problem...
  • Matt A

    I struggled with this error for a long time and I found that, even though I didnt think this was the problem, one of my .dll references was bad. When I removed it, everything worked fine. You should check all of your references in your projects...


  • Ali52

    Beware that the code in your control may run while the form designer is using it. For example, the Paint event will run as will your constructors. Does your control do anything with file paths Suppress code execution while the designer is using it by checking the DesignMode property.


  • Dan_Dan

    I know, my problem was the same. My program ran great, which is why I didnt think it was a reference either. But, it was...


  • John_from_Donetsk

    My code do use filepaths, but I don't have any code in the Load or Initialize event of the control. Where do I check the DesignMode property I can't see it in the properties of the control (where I edit it), and I can't even place it in a form, because that error shows up.

    What can I do


  • Jim Butts

    I'd put the test before the code that uses filepaths...


  • RonanDiniz

    I added to the solution another project - a control library. In it, I created a control. The error happends when I try to draw the control on the form. I tried also to add a usercontrol to the main project and put in it the same code and objects, but the error occured again.
  • "the path is not of a legal form" error