Search results

  1. P

    Updating Listbox in Another Form

    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...
  2. P

    Using DateTime and Printing it in textbox

    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.
  3. P

    Adding textbox input to array

    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!
  4. P

    Using DateTime and Printing it in textbox

    Sorry, finally found the button to insert the code, I'm used to the brackets icon stackoverflow has, didn't know the code button was in the drop down menu. I fixed my post as well as the solution! :)
  5. P

    Parsing Strings

    Thanks Sheepings and Skydiver for your help!
  6. P

    Radio Buttons Question

    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...
  7. P

    Using DateTime and Printing it in textbox

    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...
  8. P

    Adding textbox input to array

    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...
  9. P

    Adding textbox input to array

    Inside my form I have this code: int[] totalScoreArray = new int[20]; 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...
  10. P

    Parsing Strings

    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; if (txtEmail.Contains("@"){ txtEmail.Text = txtEmail.Split("@"); Could someone please help me out?
  11. P

    Parsing Strings

    So would you say they are type Textbox that accept only string variables? I want to make sure I’m saying it correctly
  12. P

    Parsing Strings

    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...
  13. P

    Radio Buttons Question

    No
  14. P

    Parsing Strings

    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...
  15. P

    Radio Buttons Question

    I tried out your steps and it worked, the 2nd radio button was selected, not sure why it's not working in my other form
  16. P

    Radio Buttons Question

    Thanks! I'll give this a try!
  17. P

    Radio Buttons Question

    So do the tab indexes inside a group box start from 1? Like what ever is in the group has tab index 1,2,3 etc and what ever is outside the group box also starts from 1,2,3..etc? I checked the tab index for the radio button I want selected when I run the form and its 0. I tried 1 but that still...
  18. P

    Radio Buttons Question

    I have a form with a group box that contains 3 radio buttons. When I run the form none of them are selected. I want the first radio button to always be selected when the form is run, but I'm not sure which property to change for that. I tried setting the Checked property to True but that didn't...
Top Bottom