Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Error 1 The type or namespace name 'Form1'

Error 1 The type or namespace name 'Form1'

Scheduled Pinned Locked Moved C#
csharphelpdatabasevisual-studiocom
8 Posts 4 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Topias Jappila
    wrote on last edited by
    #1

    I am getting error

    Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?)

    on the subject while trying to build this with Visual C#:

    using System;
    using System.Windows.Forms;
    using SKYPE4COMLib; // Our COM library

    namespace SkypeBing
    {
    public partial class Form1 : Form
    {
    private Skype skype;
    private const string trigger = "!"; // Say !help
    private const string nick = "BOT";

        public Form1()
        {
            InitializeComponent();
        }
    
        private void Form1\_Load(object sender, EventArgs e)
        {
            skype = new Skype();
            // Use skype protocol version 7 
            skype.Attach(7, false);
            // Listen 
            skype.MessageStatus +=
              new \_ISkypeEvents\_MessageStatusEventHandler(skype\_MessageStatus);
        }
        private void skype\_MessageStatus(ChatMessage msg,
                     TChatMessageStatus status)
        {
    
                // Remove trigger string and make lower case
                string command = msg.Body.Remove(0, trigger.Length).ToLower();
    
                // Send processed message back to skype chat window
                skype.SendMessage(msg.Sender.Handle, nick +
                      " Says: " + ProcessCommand(command));
            
        }
    
        private string ProcessCommand(string str)
        {
            string result;
            switch (str)
            {
                case "uli":
                    result = "http://www.youtube.com/watch?v=VfvBQMqCZw8";
                    break;
    
                default:
                    result = "Uliuli";
                    break;
            }
    
            return result;
        }
    }
    

    }

    Whole error:

    Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19 33 Skaip

    That is the whole error. Line 99 Column 33

    L S A 3 Replies Last reply
    0
    • T Topias Jappila

      I am getting error

      Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?)

      on the subject while trying to build this with Visual C#:

      using System;
      using System.Windows.Forms;
      using SKYPE4COMLib; // Our COM library

      namespace SkypeBing
      {
      public partial class Form1 : Form
      {
      private Skype skype;
      private const string trigger = "!"; // Say !help
      private const string nick = "BOT";

          public Form1()
          {
              InitializeComponent();
          }
      
          private void Form1\_Load(object sender, EventArgs e)
          {
              skype = new Skype();
              // Use skype protocol version 7 
              skype.Attach(7, false);
              // Listen 
              skype.MessageStatus +=
                new \_ISkypeEvents\_MessageStatusEventHandler(skype\_MessageStatus);
          }
          private void skype\_MessageStatus(ChatMessage msg,
                       TChatMessageStatus status)
          {
      
                  // Remove trigger string and make lower case
                  string command = msg.Body.Remove(0, trigger.Length).ToLower();
      
                  // Send processed message back to skype chat window
                  skype.SendMessage(msg.Sender.Handle, nick +
                        " Says: " + ProcessCommand(command));
              
          }
      
          private string ProcessCommand(string str)
          {
              string result;
              switch (str)
              {
                  case "uli":
                      result = "http://www.youtube.com/watch?v=VfvBQMqCZw8";
                      break;
      
                  default:
                      result = "Uliuli";
                      break;
              }
      
              return result;
          }
      }
      

      }

      Whole error:

      Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19 33 Skaip

      That is the whole error. Line 99 Column 33

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Which line does the error occur on?

      Use the best guess

      T 1 Reply Last reply
      0
      • L Lost User

        Which line does the error occur on?

        Use the best guess

        T Offline
        T Offline
        Topias Jappila
        wrote on last edited by
        #3

        Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19 33 Skaip

        That is the whole error. Line 99 Column 33

        L 1 Reply Last reply
        0
        • T Topias Jappila

          I am getting error

          Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?)

          on the subject while trying to build this with Visual C#:

          using System;
          using System.Windows.Forms;
          using SKYPE4COMLib; // Our COM library

          namespace SkypeBing
          {
          public partial class Form1 : Form
          {
          private Skype skype;
          private const string trigger = "!"; // Say !help
          private const string nick = "BOT";

              public Form1()
              {
                  InitializeComponent();
              }
          
              private void Form1\_Load(object sender, EventArgs e)
              {
                  skype = new Skype();
                  // Use skype protocol version 7 
                  skype.Attach(7, false);
                  // Listen 
                  skype.MessageStatus +=
                    new \_ISkypeEvents\_MessageStatusEventHandler(skype\_MessageStatus);
              }
              private void skype\_MessageStatus(ChatMessage msg,
                           TChatMessageStatus status)
              {
          
                      // Remove trigger string and make lower case
                      string command = msg.Body.Remove(0, trigger.Length).ToLower();
          
                      // Send processed message back to skype chat window
                      skype.SendMessage(msg.Sender.Handle, nick +
                            " Says: " + ProcessCommand(command));
                  
              }
          
              private string ProcessCommand(string str)
              {
                  string result;
                  switch (str)
                  {
                      case "uli":
                          result = "http://www.youtube.com/watch?v=VfvBQMqCZw8";
                          break;
          
                      default:
                          result = "Uliuli";
                          break;
                  }
          
                  return result;
              }
          }
          

          }

          Whole error:

          Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19 33 Skaip

          That is the whole error. Line 99 Column 33

          S Offline
          S Offline
          Simon_Whale
          wrote on last edited by
          #4

          I have a feeling that you have not included the namespace in program.cs that Form1 is using i.e.

          Form1 Myform = new form();

          When you should of possibly done

          SkypeBing.Form1 Myform = new SkypeBing.Form1();

          Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON

          1 Reply Last reply
          0
          • T Topias Jappila

            Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19 33 Skaip

            That is the whole error. Line 99 Column 33

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Topias Jäppilä wrote:

            C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19

            I think you actually mean line 19. However, you also have not shown us the content of Program.cs so we cannot guess what is wrong in there.

            Use the best guess

            T 1 Reply Last reply
            0
            • L Lost User

              Topias Jäppilä wrote:

              C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19

              I think you actually mean line 19. However, you also have not shown us the content of Program.cs so we cannot guess what is wrong in there.

              Use the best guess

              T Offline
              T Offline
              Topias Jappila
              wrote on last edited by
              #6

              Well only .cs I have on my project is Form1.cs and that makes me wondering why it says something about Program.cs

              L 1 Reply Last reply
              0
              • T Topias Jappila

                Well only .cs I have on my project is Form1.cs and that makes me wondering why it says something about Program.cs

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Topias Jäppilä wrote:

                only .cs I have on my project is Form1.cs

                Have a look in the Solution Explorer window and you will see a full list of all source files in your project.

                Use the best guess

                1 Reply Last reply
                0
                • T Topias Jappila

                  I am getting error

                  Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?)

                  on the subject while trying to build this with Visual C#:

                  using System;
                  using System.Windows.Forms;
                  using SKYPE4COMLib; // Our COM library

                  namespace SkypeBing
                  {
                  public partial class Form1 : Form
                  {
                  private Skype skype;
                  private const string trigger = "!"; // Say !help
                  private const string nick = "BOT";

                      public Form1()
                      {
                          InitializeComponent();
                      }
                  
                      private void Form1\_Load(object sender, EventArgs e)
                      {
                          skype = new Skype();
                          // Use skype protocol version 7 
                          skype.Attach(7, false);
                          // Listen 
                          skype.MessageStatus +=
                            new \_ISkypeEvents\_MessageStatusEventHandler(skype\_MessageStatus);
                      }
                      private void skype\_MessageStatus(ChatMessage msg,
                                   TChatMessageStatus status)
                      {
                  
                              // Remove trigger string and make lower case
                              string command = msg.Body.Remove(0, trigger.Length).ToLower();
                  
                              // Send processed message back to skype chat window
                              skype.SendMessage(msg.Sender.Handle, nick +
                                    " Says: " + ProcessCommand(command));
                          
                      }
                  
                      private string ProcessCommand(string str)
                      {
                          string result;
                          switch (str)
                          {
                              case "uli":
                                  result = "http://www.youtube.com/watch?v=VfvBQMqCZw8";
                                  break;
                  
                              default:
                                  result = "Uliuli";
                                  break;
                          }
                  
                          return result;
                      }
                  }
                  

                  }

                  Whole error:

                  Error 1 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Topsu\Documents\Visual Studio 2012\Projects\Skaip\Skaip\Program.cs 19 33 Skaip

                  That is the whole error. Line 99 Column 33

                  A Offline
                  A Offline
                  Anna King
                  wrote on last edited by
                  #8

                  I am not getting it, on which line does this error occur? Please check your solution explorer to discover it.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups