小编Ber*_*rdo的帖子

永远不会将字段xxx分配给,并始终将其默认值设置为null

谁知道这个问题是什么?

我得到这个警告现场XXX永远不会分配给,永远有它的默认值零private static Quantizer quantit;

我不知道该怎么做才能修复,因为当我尝试使用quantit.Quantize()debug时说:"对象引用未设置为对象的实例." 并指向au = quantit.Quantize();

代码:

public class Quantization : System.Windows.Forms.Form
{ 
    private static Quantizer quantit;

    private Button btnLoad;
    private PictureBox imgPhoto;

    public Quantization()
    {

        btnLoad = new Button();
        btnLoad.Text = "&Load";
        btnLoad.Left = 10;
        btnLoad.Top = 10;
        btnLoad.Click += new System.EventHandler(this.OnLoadClick);

        imgPhoto = new PictureBox();
        imgPhoto.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        imgPhoto.Width = this.Width / 2;
        imgPhoto.Height = this.Height / 2;
        imgPhoto.Left = (this.Width - imgPhoto.Width) / 2;
        imgPhoto.Top = …
Run Code Online (Sandbox Code Playgroud)

c# oop debugging

10
推荐指数
1
解决办法
7万
查看次数

标签 统计

c# ×1

debugging ×1

oop ×1