Click here to Skip to main content
16,016,460 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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
Posted
Comments
woutercx 28-Jul-12 6:10am    
Please provide the source code

You must be using the textbox.Text property with parenthesis
C#
textbox1.Text()


Remove the parenthesis .

It should look like

C#
string name= textbox1.Text; 
 
Share this answer
 
This is the solution:

string sendTo = txtSendTo.Text;


instead of

string sendTo = txtSendTo.Text();
 
Share this answer
 
v2
Comments
bbirajdar 28-Jul-12 6:16am    
correct +5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900