wooglin Posted October 24, 2003 Posted October 24, 2003 Can someone help me default my numerous radiobuttons per the current date? Basically what I am looking for is the program to look at the system date, determine whether it is Monday, Tuesday...etc., then have the radio button checked as the default date (IE, if its Tuesday, the Tuesday radio button is checked....etc) Code so far: Select Case Format(Now, "dddd") Case "Monday" btnMonday.Checked = True Case "Tuesday" btnTuesday.Checked = True Case "Wednesday" btnWednesday.Checked = True Case "Thursday" btnThursday.Checked = True Case "Friday" btnFriday.Checked = True Case "Saturday" btnSaturday.Checked = True End Select All help is appreciated. Quote
*Experts* Volte Posted October 24, 2003 *Experts* Posted October 24, 2003 Use the DayOfWeek property of the DateTime object to check what day it is. Quote
wooglin Posted October 24, 2003 Author Posted October 24, 2003 I am not sure what you mean?? is there a way I can just code it to reconize the current day of the week, then set my radiobuttons to default to current day? Quote
*Experts* Volte Posted October 24, 2003 *Experts* Posted October 24, 2003 Use DateTime.Now.DayOfWeek. Just for example:If DateTime.Now.DayOfWeek = DayOfWeek.Tuesday Then MessageBox.Show("It's Tuesday!") End If Quote
wooglin Posted October 24, 2003 Author Posted October 24, 2003 Just figured it out. What I did was put the select case in the form load section, so that when the form loads, btnFriday is defaulted, because today is Friday. Then I can change the button to, say Tuesday, and the info for Tuesday pulls up when asked.... Thanks for your help (or at leasttrying)! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.