Thread: Disabling focus on a form

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    10

    Unhappy Disabling focus on a form

    i created a button on a form(SHOW button on Electronic diary) which is supposed to link to another form(Appointment Details) so i can enter details...

    My problem is, when the Second form is open, the previous can still be accessed and used(still active) and i want a situation where only one task can be done at a time (this way, you cant add new appointment while showing details..etc).

    Please i need help on how to disable the access to the prev form(Electronic Diary,even tho its still open) i have attached a copy of the image of both forms so as to further give you a visual image of my prob. thank you :-)

  2. #2
    Registered User
    Join Date
    Oct 2007
    Posts
    10

    Smile :-)

    alternative solutions are also welcome

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Use a modal dialog.

    Set the 'enabled' or 'visible' property on the other dialogs/controls.

    Handle changes in the 'focus'.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    10

    thank you

    Thanx you all for all your advice. for all of you who might be experiencing the same problem

    i initially used this code, which was the reason for me posting this problem
    Code:
    Appointmen_ShowScreen^ showAppointForm = gcnew Appointmen_ShowScreen();
    			 showAppointForm->Show();
    then i realised to make the only active form(showAppointForm) the only accessing form out of the two, i used the showDialog method instead.Below is the code
    Code:
    Appointmen_ShowScreen^ showAppointForm = gcnew Appointmen_ShowScreen();
    			 showAppointForm->ShowDialog();
    THANX!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Accessing main form from functions in other classes
    By pj_martins in forum C++ Programming
    Replies: 1
    Last Post: 11-05-2004, 09:27 AM
  2. My UserControls dissapear off my form
    By zMan in forum C# Programming
    Replies: 2
    Last Post: 09-15-2004, 08:55 AM
  3. Making an MFC form to suit
    By TJJ in forum Windows Programming
    Replies: 1
    Last Post: 04-17-2004, 11:20 AM
  4. I need help disabling Keyboard and Mouse input on Edit controls
    By Templario in forum Windows Programming
    Replies: 4
    Last Post: 01-07-2003, 12:59 AM
  5. Focus & Always-On-Top :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 06-13-2002, 05:44 PM