Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am developing windows application using c# 2010 and using crystal report, for this report i am passing my form text box values to crystal report using text object. but i got a display text box -
C#.NET
System.Windows.Forms.TextBox


-how to solve this error please any one guide me.

What I have tried:

I got a message from using textbox System.Windows.Forms.TextBox
Posted
Updated 9-Apr-16 23:45pm

1 solution

Instead of passing the textbox - or using ToString on a Text box - use the Text property.
If you use this:
C#
TextBox myTextBox = new TextBox();
myTextBox.Text = "hello";
string s = myTextBox.ToString();

You will get "System.Windows.Forms.TextBox, Text: hello"
If you use this:
C#
TextBox myTextBox = new TextBox();
myTextBox.Text = "hello";
string s = myTextBox.Text;

You will get "hello"
 
Share this answer
 
Comments
Boopalslm 10-Apr-16 5:49am    
It's working fine thanks a lot.
OriginalGriff 10-Apr-16 6:02am    
You're welcome!

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