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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. call form problem?

call form problem?

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 4 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.
  • M Offline
    M Offline
    miss YY
    wrote on last edited by
    #1

    Now i have form1 and form2 datetimepicker1 and datetimepicker2 is in form1 i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this string from, to; from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd"); it can work very well then wrote my code on form2 like this Form1 frm=new Form1(); string from, to; from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd"); when i run my code ,from=2010-01-09,to=2010-01-09 on form2 but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1, then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning. i want to get the changed dateTimePicker.Value,how could i do thanks everyone?

    D T C 3 Replies Last reply
    0
    • M miss YY

      Now i have form1 and form2 datetimepicker1 and datetimepicker2 is in form1 i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this string from, to; from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd"); it can work very well then wrote my code on form2 like this Form1 frm=new Form1(); string from, to; from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd"); when i run my code ,from=2010-01-09,to=2010-01-09 on form2 but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1, then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning. i want to get the changed dateTimePicker.Value,how could i do thanks everyone?

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      You posted here[^] a couple of days ago and didn't respond to any of the answers given. [Edit] And here[^] too previously. [/Edit]

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Why are you using VB6? Do you hate yourself? (Christian Graus)

      1 Reply Last reply
      0
      • M miss YY

        Now i have form1 and form2 datetimepicker1 and datetimepicker2 is in form1 i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this string from, to; from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd"); it can work very well then wrote my code on form2 like this Form1 frm=new Form1(); string from, to; from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd"); when i run my code ,from=2010-01-09,to=2010-01-09 on form2 but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1, then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning. i want to get the changed dateTimePicker.Value,how could i do thanks everyone?

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

        This is a Cross post... And you have posted it a couple of times.. I advice others not to Encourage cross post... You will never get replies for cross post except that "This is a cross post" message from everyone.. Cheers, Tash

        1 Reply Last reply
        0
        • M miss YY

          Now i have form1 and form2 datetimepicker1 and datetimepicker2 is in form1 i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this string from, to; from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd"); it can work very well then wrote my code on form2 like this Form1 frm=new Form1(); string from, to; from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd"); to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd"); when i run my code ,from=2010-01-09,to=2010-01-09 on form2 but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1, then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning. i want to get the changed dateTimePicker.Value,how could i do thanks everyone?

          C Offline
          C Offline
          carlecomm
          wrote on last edited by
          #4

          Use the ValueChanged event: this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged); private void dateTimePicker1_ValueChanged(object sender, EventArgs e) { //notify form2 the selected date is changed. }

          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