473,408 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

forms error

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
3 1050
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
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
Thanks both for your replys, Ill give these a go and let you know how
it goes.
Regards Robert

May 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
1
by: MJ | last post by:
I'm building an application that has a file structure similar to the following: /myapp/user_login.aspx /myapp/user_page_1.aspx /myapp/user_page_2.aspx /myapp/user_page_3.aspx...
3
by: 20041210.20.eclipse | last post by:
Hi, I'm using MS Visual Studio .NET 2003 Standard on WinXP Home on a DELL Notebook. It is not possible to create a project that contains windows forms. When trying to create a Windows Forms...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
2
by: Thomas Scheiderich | last post by:
I am trying to set up forms authentication in my IIS pages. I have a folder inside of my root folder I am trying to protect and I am getting an error when a page in the folder is accessed. The...
1
by: Sumaira Ahmad | last post by:
Hi, Please help me with this.. I am trying to use Forms Authentication in a sample project. I basically want to have two folders in my application , one in which I store pages that can be...
3
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes...
6
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns...
0
by: Tony Johansson | last post by:
Hello! I have a very specific question and that is about how to inherit a visual control for example the control System.Windows.Forms.TextBox without causing the environment to delete the...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.