open each dialog in the same position

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 42
Reputation: lahom is an unknown quantity at this point 
Solved Threads: 0
lahom lahom is offline Offline
Light Poster

open each dialog in the same position

 
0
  #1
Jun 3rd, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: open each dialog in the same position

 
0
  #2
Jun 3rd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 42
Reputation: lahom is an unknown quantity at this point 
Solved Threads: 0
lahom lahom is offline Offline
Light Poster

Re: open each dialog in the same position

 
0
  #3
Jun 3rd, 2008
Originally Posted by Duoas View Post
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.
"
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: open each dialog in the same position

 
0
  #4
Jun 3rd, 2008
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:
  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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: open each dialog in the same position

 
0
  #5
Jun 4th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC