c#中的使用问题基础 [英] problem in use base in c#

查看:116
本文介绍了c#中的使用问题基础的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<pre lang="css">public class TxtProNet : TextBox
  {
    private Color FBC;
    private Color FFC;
    private Font FF;
    private bool FTS;
    private Color LFBC;
    private Color LFFC;
    private Font LFF;
    private bool ETT;
    private bool ETC;
    private bool AS;
    private bool MER;
    public double TextValue;
    private bool TFO;
    private bool TEO;
    private bool TNO;
    private bool TDS;
    private bool TAC;
    private bool CTRL;
    private bool ALT;
    private bool SHIFT;
    private string TOC;
    private string ME;
    public string NumberToChar;
    private int i;
    private string YY;
    private string STR;
    private bool MESD;
    private bool MEIFS;



    public TxtProNet()
    {
      this.FBC = Color.Yellow;
      this.FFC = Color.Blue;
      this.FF = Control.DefaultFont;
      this.FTS = true;
      this.ETT = true;
      this.ETC = true;
      this.MER = true;
      this.TAC = true;
      this.TOC = "";
      this.ME = "";
      this.NumberToChar = "صفر";
   base.\u002Ector();//<<-------problem
    }
}

推荐答案

你这样称呼它;

You call it like this;
public TxtProNet() : base() {
 // ...
}





它不是从构造函数中调用的,必须调用它第一个。



希望这会有所帮助,

Fredrik



It's not called from within the constructor, it has to be called first.

Hope this helps,
Fredrik


这篇关于c#中的使用问题基础的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆