Disabling focus on a form

This is a discussion on Disabling focus on a form within the Windows Programming forums, part of the Platform Specific Boards category; i created a button on a form(SHOW button on Electronic diary) which is supposed to link to another form(Appointment Details) ...

  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 :-)
    Attached Images Attached Images  

  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,859
    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, 09:55 AM
  3. Making an MFC form to suit
    By TJJ in forum Windows Programming
    Replies: 1
    Last Post: 04-17-2004, 12:20 PM
  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, 06:44 PM

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