hi
i have created adialog based application where each of them call the other using DoModal().
my question is : if Dialog A is in some position on the screen and then called Dialog B...i want for Dialog B to take the same exactly position as Dialog A .(to be on top of it )...
how can i do that??
thanks

DialogA is in a separate exe than DialogB?

You will need to play with the STARTUPINFO structure when you call CreateProcess().

Either that or just set both dialogs to center themselves on the screen or on their parent when they are used.

Hope this helps.

DialogA is in a separate exe than DialogB?

You will need to play with the STARTUPINFO structure when you call CreateProcess().

Either that or just set both dialogs to center themselves on the screen or on their parent when they are used.

Hope this helps.

no ..they r in the same .exe

and what do u mean by "set both dialogs to center themselves on the screen or on their parent when they are used.
"

That makes it considerably easier. Just set your dialogues to center themselves on the screen or above their parent window.

You can set this several ways:
1. Set the Position property in the Object Inspector.
2. Position the form in the dialog constructor.
3. Override ShowModal as something like the following:

int TForm1::ShowModal()
  {
  // set form position here
  ...
  // pass off to inherited
  return TForm::ShowModal();
  }

(I just typed this in off the top of my head. Some adjustments may be necessary, since I tend to use Delphi more than C++Builder for Windows GUI development).

Hope this helps.

This article has been dead for over six months. Start a new discussion instead.