Search code examples
c++buildervcl

How to create Modal and Modeless forms in borland c++ builder


I have an assignment to enhance an already existing tool written in Borland c++, I am new to programming and c++ builder. The task is to integrate message box which pops up, in to the main form itself,which I have successfully done by adding a new form to the project and calling it in place of message box. I have made my new form modal so that control is blocked,till user selects an option.

Now I have added another form named graph to the project to show a graph and I want the control to go to the graph when user clicks a button in the new form.

Is there a way to make two children modeless and block only the parent form(modal).In short I want to access both the new forms I have added to my project and I don't want to access my main form,till I make all selections in these two forms.Kindly help!


Solution

  • Rather than using ShowModal(), you could set the parent Form's Enabled property to false, use Show() to show both forms, and then set the parent Form's Enabled property back to true when both forms have been closed.