那怎么在Form1中输出数据呢?好多方法都没有。 不知道怎么搞的。有哪位大侠写一个简单的程序 给我看看,感激不尽。下面是我的程序: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms;//我的书上写的是System.WinForms命名空间namespace WindowsApplication1 { public class Form1 : System.Windows.Forms.Form { private System.ComponentModel.Container components; private ListBox listBox1; private int nltems=0; public void Addltem(string sltem) { object oltem=sltem; listBox1.InserItem(nltems,oltem); ++nltems; } public Form1() {
InitializeComponent(); Addltem("An item of output"); Addltem("2nd bit of output"); Addltem("More output"); } static void Main() { Application.Run(new Form1()); } } } 编绎时listbox1中没有 InserItem和InitializeComponent() 方法。
不知道怎么搞的。有哪位大侠写一个简单的程序
给我看看,感激不尽。下面是我的程序:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;//我的书上写的是System.WinForms命名空间namespace WindowsApplication1
{
public class Form1 : System.Windows.Forms.Form
{
private System.ComponentModel.Container components;
private ListBox listBox1;
private int nltems=0;
public void Addltem(string sltem)
{
object oltem=sltem;
listBox1.InserItem(nltems,oltem);
++nltems;
}
public Form1()
{
InitializeComponent();
Addltem("An item of output");
Addltem("2nd bit of output");
Addltem("More output");
}
static void Main()
{
Application.Run(new Form1());
}
}
}
编绎时listbox1中没有 InserItem和InitializeComponent() 方法。
那是Beta1时的 namespace,Beta2开始就改了
找本新点的书看吧,费了一本书好过费时间啊