views:

108

answers:

1

Hey Everyone,

I have a datetime picker in one of our apps. When loading up the win form I need the date time picker to default to the Wednesday following todays date. Any idea how to do this? We are using .Net 1.1 for this app.

Thanks, Mike

+1  A: 

this should do it...just add days until you hit the next wednesday

Public Function GetNextDayOfWeek(ByVal dow As DayOfWeek) As DateTime
       Dim d = DateTime.Now.AddDays(1)
       While d.DayOfWeek <> dow
           d = d.AddDays(1)
       End While

       Return d
   End Function
dotjoe
Duh!! Thanks so much for helping me over my brain fart!
Mike