How to bring mdichild to foreground

How to bring mdichild to foreground

Postby James Bott » Tue Oct 24, 2006 10:49 pm

Doews anyone have any idea how to bring a mdichild window to the foreground (make it active)? I have tried setForegroundWindow(), setFocus(), and setActiveWindow() and none seem to work.

In the following example, pressing any of the buttons should bring the clients window to the foreground--at least it appears that it should from the documentation. I must be doing something wrong.

Oh, I also tried showWindow() and that didn't work either.

James

Code: Select all  Expand view
#include "fivewin.ch"

function main()
   local oWnd, oBar

   define window oWnd MDI

   define buttonbar oBar of oWnd

   define button of oBar ;
      action setForegroundWindow( oWnd:oWndClient:aWnd[1]:hWnd )
   define button of oBar ;
      action setFocus( oWnd:oWndClient:aWnd[1]:hWnd )
   define button of oBar ;
      action setActiveWindow( oWnd:oWndClient:aWnd[1]:hWnd )

   activate window oWnd on init (clients(), matters() )

return nil

function clients()
   local oWnd
   define window oWnd title "Clients" mdichild of wndMain()
   activate window oWnd
return nil

function matters()
   local oWnd
   define window oWnd title "Matters" mdichild of wndMain()
   activate window oWnd
return nil
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Tue Oct 24, 2006 11:07 pm

I found the answer:

wndMain():oWndClient:aWnd[1]:setFocus()

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Natter, Otto and 77 guests