very simple Enumerators, help please?
-
summers over school is in, yet again. heh, well, for the past 5 months or so on my school vacation, i hadnt used VB.net. now im lost again :S first off: im not asking you to do my homework, im asking for help.. my project is as follows: two text boxes, and one button. i need to write a program to find the difference (number of days) between 2 entered days (ex, day1 = monday, day2= friday, difference = 4 days. i have an enum like this:
Private Enum DaysOfWeek Monday = 1 Tuesday Wednesday Thursday Friday Saturday Sunday End Enum
i also have 2 variables that i made of the enum type (startDay and endDay). i set startDay and endDay's value = their respective textboxes.text, which the user enters a day of week. i get cast from string to integer error (i know, because enums must only be integer values, right?) so how can i do this? (sorry if being broad, again, im not asking you to do my homework for me, im asking for help.) thank you ------------------------ Jordan. III
-
summers over school is in, yet again. heh, well, for the past 5 months or so on my school vacation, i hadnt used VB.net. now im lost again :S first off: im not asking you to do my homework, im asking for help.. my project is as follows: two text boxes, and one button. i need to write a program to find the difference (number of days) between 2 entered days (ex, day1 = monday, day2= friday, difference = 4 days. i have an enum like this:
Private Enum DaysOfWeek Monday = 1 Tuesday Wednesday Thursday Friday Saturday Sunday End Enum
i also have 2 variables that i made of the enum type (startDay and endDay). i set startDay and endDay's value = their respective textboxes.text, which the user enters a day of week. i get cast from string to integer error (i know, because enums must only be integer values, right?) so how can i do this? (sorry if being broad, again, im not asking you to do my homework for me, im asking for help.) thank you ------------------------ Jordan. III
Instead of casting string to enum use the Enum.Parse method to convert the string to Enum.
-
Instead of casting string to enum use the Enum.Parse method to convert the string to Enum.