Solved

Forms in SDI Application do not become active

Posted on 2003-11-11
5
231 Views
Last Modified: 2010-04-05
Hi Experts,

Got a funny one... I have created an application that has a main host form that is very ms outlookish with the nav bar on the left. When I click on a button of the nav bar it shows an auto-created form with the very simple:

frmSampleForm.Show;          //show my auto-created form
frmSampleForm.Parent := frmMain.pnMainStage;         //make the panel pnMainStage the parent to 'hold' the newly displayed form

The problem is this, when I select a few buttons and have multiple SDI forms just floating around on the pnMainStage panel non of them are active even when they have focus. The title bar just remains the same opaque blue as when it was inactive. Even if I only have one 'child'(with respect to the main form not in MDI relationship) form this still occurs. When the 'child' windows are cascaded upon each other I have to actually select the title bar to bring it to the front/top, selecting anywhere else on the form doesn't do so.

ideas anyone?? Thanks

Ian
0
Comment
Question by:beavei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9721401
usual you have no sdi-app, its more a pseudo-mdi-app
(just because you parented your childs)

to get an active-caption, you must call
setActiveWindow(ChildHandleHere);
by hand

meikl ;-)
0
 
LVL 17

Expert Comment

by:geobul
ID: 9721472
Hi,

This is because only one window can be selected by default (have a highlighted caption) and it is the main form in your case.

Regards, Geo
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 125 total points
ID: 9721489
hmm, digged a bit in my asked questions:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20358590.html

--- the answer from lee_nover
hi
try this:

..
private
    { Private declarations }
    procedure CMMouseEnter(var Msg: TMessage); message CM_MOUSEENTER;
..

procedure TForm2.CMMouseEnter(var Msg: TMessage);
begin
     PostMessage(Handle, WM_NCACTIVATE, 1, 0);
end;


works for me :)
-----------

meikl ;-)
0
 

Author Comment

by:beavei
ID: 9721900
Pseudo-MDI App, yep that's what it is.... :)

Thanks Guys, I will have a play with it over the next couple of days and get back to you...

Ian
0
 

Author Comment

by:beavei
ID: 9745564
Thanks for the info, it works. Although I have run into a couple more problems which I will ask in another question.

Cheers,

Ian
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question