Yesterday i asked this question: Get current time and set a value in a combobox
Now i´m having another issue that i have to deal with. In the question that i asked yesterday i had three times zones in my combobox:
06:00 – 14:00 the combobox will get the value TimeZone 1
14:01 – 22:00 the combobox will get the value TimeZone 2
22:01 – 05:59 the combobox will get the value TimeZone 3
And i also have a datTimePicker were the user can choose a date. Let´s say that the user choose: 2011-02-02 and in the timezone combobox choose TimeZone 2. If this happens i want to create a method that only search for the time. between 14:01 – 22:00 (wich are TimeZone 2). And if the user choose TimeZone 3 it will only search for the time between 22:01 – 05:59.
Any ideas?
You could create a Period holder class containing the Type, the from and to time. This can be inserted into a collection like a IList which can be used as datasource for your combobox. Something like this example: