Forms

This is a discussion on Forms within the C# Programming forums, part of the General Programming Boards category; Hello everyone, I am trying to understand something here. I have a windows app that starts out with a main ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    184

    Forms

    Hello everyone,

    I am trying to understand something here. I have a windows app that starts out with a main screen. You click a toolbar button and it opens up an appointments screen. In the Form's class declaration, I create an instance of a user defined class. I have a timer declared within that user defined class. It seems that from the main form when I create an instance of the appointments form, it hits the class declaration for the user defined class for the first time. But it hits it a second time when the code says form.show(). It is like it is creating 2 instances of the timer. When you actually create and then show a form, do the classes that are created within that form actually get initialized 2 times????? Why would my timer be created 2 times. I only have one new statement for the timer and that is withing the form class header.

    Thanks,
    Kendal

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    Can you post some code how you create and show the second from and how you create and start the timer ?
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    184
    Okay,
    I just found the problem.
    It was my fault.
    In the appointments code, I actually had 2 classes defined:
    Doctors and MySQL.
    The appointments form created and instance of MySQL and so did Doctors. That is what I was looking over, Doctors.

    Thanks a million for the reply,
    Kendal

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Good introduction to Windows Forms?
    By jcafaro10 in forum C# Programming
    Replies: 1
    Last Post: 05-19-2009, 06:11 PM
  2. Replies: 2
    Last Post: 04-02-2009, 04:40 AM
  3. Closing all forms from a derived form
    By Pete_O in forum C# Programming
    Replies: 1
    Last Post: 09-01-2007, 01:09 PM
  4. C# Game using Forms
    By ejohns85 in forum C# Programming
    Replies: 1
    Last Post: 12-16-2006, 04:35 PM
  5. Which one :MFC, Win32, Windows Forms (.Net)?
    By Robert_Sitter in forum Windows Programming
    Replies: 6
    Last Post: 11-17-2005, 05:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21