Example to open Config Form on Non Gui Plugin (1 Viewer)

charli181

Retired Team Member
  • Premium Supporter
  • August 3, 2007
    800
    111
    Sydney
    Home Country
    Australia Australia
    Hi,
    Still learning C# and cannot seem to get it to open my config Form. The project wont even build. I keep getting errors here....

    public void ShowPlugin()
    {
    SetupForm SetupForm1 = new SetupForm();
    SetupForm1.ShowDialog();
    }

    I have a form in the project called SetupForm

    C#2005 shows error....

    Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\project\1- MediaPortal Plugins\Voicemail\Voicemail1\Class1.cs 144 13 Voicemail1


    Any Ideas as the doco's just show a message box for the config option.....

    Thanks in advance and sorry to pester all.
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    Hey again,

    The error message you quote doesn't match the code in question. The error message says "Form1" but you're referencing "SetupForm1" in the code. Are you sure this is where the error is?

    Maybe you pasted the message and then changed the code... so here's what it could be in that case...

    Maybe your form is in a different namespace to the rest of the code. So you may need to add a "using plugin.forms;"

    Or you may need to refer to the SetupForm class by it's fully qualified name, something like:

    MediaPortal.Plugins.Forms.SetupForm SetupForm1 = new MediaPortal.Plugins.Forms.SetupForm();

    If you get really stuck you could attach the full source (zipped up) to this post and I could take a look for you?

    Cheers,
     

    charli181

    Retired Team Member
  • Premium Supporter
  • August 3, 2007
    800
    111
    Sydney
    Home Country
    Australia Australia
    Aaron,

    I am going to start the project again, as it seems to be giving strange errors. I have been changing things in the code and names of forms so many times. I even found some source files in the forums and set it up the same way and still no go so that why I am starting again. not much code to copy and paste. WIll attack it again tomorrow.

    Thanks Again

    Sean
     

    Users who are viewing this thread

    Top Bottom