Zesa Rex Zesa Rex - 1 year ago 133
C# Question

How to make a textbox show me double?

I am trying to get myself used to C#, currently I am using SharpDevelop for that Task, anyway, I have a simple question, let's say I want to have a TextBox that Shows me the outcome of a mathematical code as shown below, how do I get the TextBox to actually Show me types like double, int, or other stuff? It always tells me it can't convert double to string or whatever, I am pretty noob so yeah.

void CmdWriteClick(object sender, EventArgs e)
double var = 8.40;
double start = 9.00;
double end = var + start;
textbox_end.Text = end;

I already tried to not use the .text but something like. value but didn't work, any help?

Answer Source

Just add .ToString()

textbox_end.Text = end.ToString()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download