943,812 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1208
  • C++ RSS
Jun 3rd, 2008
0

open each dialog in the same position

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
lahom is offline Offline
42 posts
since Apr 2008
Jun 3rd, 2008
0

Re: open each dialog in the same position

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.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Jun 3rd, 2008
0

Re: open each dialog in the same position

Click to Expand / Collapse  Quote originally posted by Duoas ...
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.
"
Reputation Points: 10
Solved Threads: 0
Light Poster
lahom is offline Offline
42 posts
since Apr 2008
Jun 3rd, 2008
0

Re: open each dialog in the same position

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:
C++ Syntax (Toggle Plain Text)
  1. int TForm1::ShowModal()
  2. {
  3. // set form position here
  4. ...
  5. // pass off to inherited
  6. return TForm::ShowModal();
  7. }
(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.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007
Jun 4th, 2008
0

Re: open each dialog in the same position

Here is one example about positioning a dialog box
http://msdn.microsoft.com/en-us/libr....aspx#init_box

You can pass the needed 'parent' dialog information through e.g. your dialogs' constructors.
Reputation Points: 1105
Solved Threads: 389
Posting Virtuoso
mitrmkar is offline Offline
1,714 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Aligning your screen ouput
Next Thread in C++ Forum Timeline: Arithmetic operation using STL





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC