我收到类似"System.Windows.Forms.TextBox.Text是属性,但像方法一样使用"的错误.请引导我 [英] i got error like "System.Windows.Forms.TextBox.Text is a property but is used like a method" pls guide me

查看:747
本文介绍了我收到类似"System.Windows.Forms.TextBox.Text是属性,但像方法一样使用"的错误.请引导我的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用c#创建一个用于发送邮件的应用程序.我遇到类似这样的错误 System.Windows.Forms.TextBox.Text是一个属性,但是像方法一样使用

i am create an application in c# for sending mail. i got some error like this System.Windows.Forms.TextBox.Text is a property but is used like a method

推荐答案

这是解决方案:

This is the solution:

string sendTo = txtSendTo.Text;



代替



instead of

string sendTo = txtSendTo.Text();


您必须使用带括号的textbox.Text属性
You must be using the textbox.Text property with parenthesis
textbox1.Text()



删除括号.

它看起来应该像



Remove the parenthesis .

It should look like

string name= textbox1.Text; 


这篇关于我收到类似"System.Windows.Forms.TextBox.Text是属性,但像方法一样使用"的错误.请引导我的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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