By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,338 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,338 IT Pros & Developers. It's quick & easy.

forms error

P: n/a
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(fals e);
Application.Run(new Form1());
}
}
}
any ideas please.
Regards Robert

May 10 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ro********@yahoo.co.uk" wrote:
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(fals e);
Application.Run(new Form1());
}
}
}
any ideas please.
Regards Robert

May 10 '06 #2

P: n/a
Hello Ro********@yahoo.co.uk,

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(fals e);
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
May 10 '06 #3

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

May 11 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.