预期方法,代表或事件 [英] method, delegate or event is expected

查看:86
本文介绍了预期方法,代表或事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..

我是初学者程序员,

当我想制作简单的程序时,我得到了一些错误。



Hi..
I'm beginner Programmer,
when I want to make simple program, I got some Error.

        string strDiurai = null;
        string Tbl1 = null;
        string [] arrBelasan = {"SEPULUH ",
    "SEBELAS ",
    "DUA BELAS ",
    "TIGA BELAS ",
    "EMPAT BELAS ",
    "LIMA BELAS ",
    "ENAM BELAS ",
    "TUJUH BELAS ",
    "DELAPAN BELAS ",
    "SEMBILAN BELAS "
};
    Tbl1 = arrBelasan(Convert.ToInt32(strDiurai)); <-- Error





错误说预计会有方法,代表或事件。

我该怎么办?



对不起我的英语不好。 :)



The error say "method, delegate or event is expected".
what Should I do?

Sorry my english not good. :)

推荐答案

这里你需要使用方括号来访问数组元素而不是括号

Here you need to use square braces for accessing array element instead of parentheses
Tbl1 = arrBelasan[Convert.ToInt32(strDiurai)];


非常感谢..



你是C#大师: ):)
Thanks you very much..

you are the Master C# :) :)


如何调用类?



how to call class?

private void btnterbilang_Click(object sender, EventArgs e)
        {
            //LHasil.Text=
            LHasil.Text = Terbilang(double.Parse(txtinput.Text)); <--ERROR
        }


这篇关于预期方法,代表或事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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