Hi, I have a textbox which I want to change the font colour when you input a number after a certain number (in my case Pi*2)..
Although the code I wrote gives me this error : Unable to cast object of type 'System.Windows.Forms.TextBox' to type 'System.IConvertible'.
I don't understand the error..
So that's what I wrote:
if (Convert.ToDouble(textBox1.Text) > Math.PI*2)
textBox1.BackColor = Color.Red;
What input was in the TextBox when this error occurred? You should wrap that if statement in a try-catch block in case the input is incorrect. Remember, an empty string or number with spaces may throw an error.
OUTPUT: d1=123456 d2=123,456
The same with TryParse.
My culture setting: Dutch(Belgium) comma
Because I tend to visit sites(eg. DaniWeb :) ) quite alot I get influenced by writing a point sometimes, when it has to be a comma overhere.
Without a warning in this situation I already had some fine time debugging, I can tell you!
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...