为什么不存在?
一个计算器小程序。出错在这里
InitializeComponent();
提示信息是:InitializeComponent是类,不存在于名词空间wincalc.calcForm里
程序代码如下:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace wincalc
{
public class calcForm : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button0;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button bDot;
private System.Windows.Forms.Button bEqu;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button bDiv;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button bMul;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button bSub;
private System.Windows.Forms.Button bClr;
private System.Windows.Forms.Button bPlus;
private System.Windows.Forms.TextBox txtCalc;
double dblAcc;
double dblSec;
bool blnClear,blnFrstOpen;
string strOper;
private System.ComponentModel.Container components = null;
public calcForm()
{
InitializeComponent();
dblAcc=0;
dblSec=0;
blnFrstOpen=true;
blnClear=true;
strOper=new string('=',1);
}
……………………