forms error

R

RobcPettit

hi I get an error saying namespace Form1 not found and Error 4 Argument
'1': cannot convert from 'Form1' to 'System.Windows.Forms.Form' I:\My
Documents\Visual Studio 2005\Projects\Betting Monitor\Betting
Monitor\Program.cs 18 29 Betting Monitor in the code
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace System.Windows.Forms

{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
any ideas please.
Regards Robert
 
G

Guest

Robert,
the very first thing to do is change the namespace of your class to
something that doesn't represent a namespace collision with a .NET Framework
BCL namespace - System.Windows.Forms.

Once you've got it changed to something less problematic such as "MyFormApp"
then come back if you still have issues.
Peter
 
M

Michael Nemtsev

Hello (e-mail address removed),

Does your Form1 inherited from Windows.Forms?
Try to create emply WinForms project to see whether this error exist


R> hi I get an error saying namespace Form1 not found and Error 4
R> Argument
R> '1': cannot convert from 'Form1' to 'System.Windows.Forms.Form' I:\My
R> Documents\Visual Studio 2005\Projects\Betting Monitor\Betting
R> Monitor\Program.cs 18 29 Betting Monitor in the code
R> using System;
R> using System.Collections.Generic;
R> using System.Windows.Forms;
R> namespace System.Windows.Forms
R>
R> {
R> static class Program
R> {
R> /// <summary>
R> /// The main entry point for the application.
R> /// </summary>
R> [STAThread]
R> static void Main()
R> {
R> Application.EnableVisualStyles();
R> Application.SetCompatibleTextRenderingDefault(false);
R> Application.Run(new Form1());
R> }
R> }
R> }
R> any ideas please.
R> Regards Robert
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
R

RobcPettit

Thanks both for your replys, Ill give these a go and let you know how
it goes.
Regards Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top