using System;
namespace it2b_project_01
{
static class class1
{
static public class1()
{
InitializeComponent();
}
public static void error_check(object sender, EventArgs e)
{
}
}
}
(different .cs file)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace it2b_project_01
{
public partial class Create_an_Order : Form
{
public Create_an_Order()
{
InitializeComponent();
}
private void Create_an_Order_Load(object sender, EventArgs e)
{
}
private void Order_Button_Submit_Click(object sender, EventArgs e)
{
class1.error_check();
开发者_开发百科 }
}
}
Create an Order.cs(26,13): error CS0103: The name 'class1' does not exist in the current context.
make
static class class1
public static class class1
it cannot find it because it is not public
Access modifiers like public are not allowed on static constructors so drop the public from the class1 constructor.
error check takes 2 paramters which your not passing in.
I did those two things and it complied.
精彩评论