Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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?

  • *Experts*
Posted
Use DateTime.Now.DayOfWeek. Just for example:
If DateTime.Now.DayOfWeek = DayOfWeek.Tuesday Then
 MessageBox.Show("It's Tuesday!")
End If

Posted

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)!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...