Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MonthCalendar Usage

MonthCalendar Usage

Scheduled Pinned Locked Moved C#
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dipuks
    wrote on last edited by
    #1

    Hey guys, I have a Form1 with a text box in it. When user clicks inside the text box it will pop up Form2 which has a MonthCalendar in it. Now after the user selects a date and click OK on Form2, i want that selected date string to be displayed in the Form1 text box. How can i get the Form2 date string to be displayed in Form1 text box? Thanks in advance.

    P T 2 Replies Last reply
    0
    • D dipuks

      Hey guys, I have a Form1 with a text box in it. When user clicks inside the text box it will pop up Form2 which has a MonthCalendar in it. Now after the user selects a date and click OK on Form2, i want that selected date string to be displayed in the Form1 text box. How can i get the Form2 date string to be displayed in Form1 text box? Thanks in advance.

      P Offline
      P Offline
      PanchoM
      wrote on last edited by
      #2

      The way I do it : On Form1 I listen for the Form2.FormClosed event like this

      Form2 myForm2;
      private void textBox1_TextChanged(object sender, EventArgs e)
      {
      myForm2 = new Form2();
      myForm2.FormClosed += new FormClosedEventHandler(myForm2_FormClosed);
      myForm2.Show();
      }

      Then when the event happens :

      void myForm2_FormClosed(object sender, FormClosedEventArgs e)
      {
      this.TextBox1.Text = myForm2.TheDate;
      }

      On Form2 you need to have a Public property TheDate which you set when they click on your calendar OnOkClick you just close the form. hope that makes sense.

      1 Reply Last reply
      0
      • D dipuks

        Hey guys, I have a Form1 with a text box in it. When user clicks inside the text box it will pop up Form2 which has a MonthCalendar in it. Now after the user selects a date and click OK on Form2, i want that selected date string to be displayed in the Form1 text box. How can i get the Form2 date string to be displayed in Form1 text box? Thanks in advance.

        T Offline
        T Offline
        theanil
        wrote on last edited by
        #3

        hope this mat help you http://www.homeandlearn.co.uk/csharp/csharp_s13p3.html[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups