Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

object of form

$
0
0
 i have this code on a form alarm.
 public DateTime mytime;
 private void button1_Click(object sender, EventArgs e)
        {
            mytime = monthCalendar1.SelectionStart.AddHours(dateTimePicker1.Value.Hour).AddMinutes(dateTimePicker1.Value.Minute).AddSeconds(dateTimePicker1.Value.Second);
        }
        private void timer1_Tick(object sender, EventArgs e)
        {
           
            if (mytime.CompareTo(DateTime.Now) < 0)
            {
                this.Show();

            }
        }
but when i try to access the controls of alarm form on other form edit. i created the object of alarm form. when i run program and com to edit form
the alarm form displayed automatically. whey this is hepninig.

i just write this code on edit form on edit form
 alarm adrr = new Alarm();

Viewing all articles
Browse latest Browse all 12583

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>