Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9159667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:32:58+00:00 2026-06-17T13:32:58+00:00

I am creating a small program which will soon develop into a timetable and

  • 0

I am creating a small program which will soon develop into a timetable and I am practicing using the C# MonthCalendar. So far I have managed to display the date selected onto a text label, however I am looking do achieve something slightly different, which I am struggling with.

I have placed seven labels on a form. When I click on a date, I want all seven labels to be populated with dates that correspond to the specific week on which the selected date is located. Can anyone suggest what I need to do to achieve this.

The problem that i want to resolve:
Lets say I select a date from the calendar. E.g 22/01/1013 so on the labels I want to display all the dates in that week starting from the 21st – 27th Jan 2012

To clarify this further:

This is the interface I have come up with:
enter image description here

And the code that I have so far:

 public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }
        private void button1_Click(object sender, EventArgs e)
        {
    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        DateTime dt = DateTime.Now;
        label8.Text = dt.ToString();
    }

    private void monthCalendar1_DateSelected(object sender, DateRangeEventArgs e)
    {
        label1.Text = monthCalendar1.SelectionStart.ToString();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:32:59+00:00Added an answer on June 17, 2026 at 1:32 pm

    From the answer of zespri and I got this idea from this answer.

    class Program
    {
        static void Main(string[] args)
        {
            DateTime t = DateTime.Now; //Your selected date from Calendar
            t -= new TimeSpan((int)t.DayOfWeek, 0, 0, 0);
            Console.WriteLine("\tstart: " + t.Date.ToShortDateString());
            Console.WriteLine("\tend: " + t.Date.AddDays(7).ToShortDateString());
            Console.WriteLine("\t" + new string('-', 25));
    
            for (int i = 0; i < 7; i++)
            {
                var d = t.AddDays(i);
                if (d.DayOfWeek >= DayOfWeek.Monday && d.DayOfWeek <= DayOfWeek.Friday) //Range: Monday to Friday
                    Console.WriteLine(d.DayOfWeek + " : " + d);
            }
            Console.ReadLine();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a small program that will read a text file, which contains a
I am creating a small application which will perform say 4 different, time consuming
I am creating a small utility which will help to rebuild install.php of WordPress.
I am creating a small Yahtzee game and i have run into some regex
I'm currently creating a small C# program that inserts data from files into a
I am creating a program which will calculate Betwenness Centrality for all nodes in
I have a program in which I am creating two appdomains A and B
I am creating a small program over entityframework which allows to edit the POCOs
I am creating a small playlist program on VB, which contains adduser, deleteuser and
I'm creating a small program which consists of a few source files on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.