I have 2 forms. Form1 contains a list box and a button that says update. If the user selects a number from the list box and clicks the update button then form2 pops up. Then the user can enter a number in form2 and click the update button. I want the number that the use enters to be updated in...
I changed my code to this and it fixed the problem.
/*Used %d to the span of days gives back a single number in the textbox*/
txtDays.Text = span.ToString("%d");
I could do that but I had to use text boxes because the assignment required me to.
Hey Skydiver, Sheepings, and jmcilhinney thanks for your help! I really do appreciate you guys correcting me when I say things wrong. jmcilhinney I made sure to write down your egg carton example, never thought of it like that, you made it really simple!
I realized I was doing everything correct but my event handler said radioButton2 the whole time and I missed that. Everything else was similar to yours but I kept overlooking the name. I'll try to make sure I name them specific names next time so I don't make the same mistake again! Thanks for...
I have this code here that I'm using to print the number of days between two dates. After the user enters the dates in 2 text boxes on my form, I have a third text box that displays the amount of days. For example: 1st text box: 1/2/2020 | 2nd text box: 1/10/2020 | 3rd textbox: 8.00:00:00. In...
First I converted the string from the text box to an int.
intScoreCount = Convert.ToInt32(txtScore.Text);
then I made a for loop
//I started at 0, made sure the length is less then 20 since you count from 0 then in the index 0 i added the variable that I used to convert the string to int...
Inside my form I have this code:
int totalScoreArray = new int;
int intScoreCount = 0;
For my assignment I need to: Modify the Click event handler for the Add button so it adds the score that’s entered by the user to the next element in the array. To do that, you can use the score count...
I'm still having trouble with this after reading about this split and trim I'm still not understanding it. This is what I have so far:
String email = txtEmail.Text;
txtEmail.Text = txtEmail.Split("@");
Could someone please help me out?
txtEmail is the name of my textbox. I know that text boxes are of type string by default. The trim method takes put spaces because the example in my book has “Sam Smith. “ and then when they used trim and commented what the string would look like after using it, the space was not there and it...
I'm trying to parse an entered email address into a text box. I want to split the entered input like this (before the @ sign and after it) BOB | @ | GMAIL.COM. This is what I have so far for my code:
txtEmail.Text = txtEmail.Trim(); // using this to trim the string to make sure there are no...