Click here to Skip to main content
15,881,644 members
Home / Discussions / C#
   

C#

 
QuestionCorrectly Disposing of MDI Child Forms. Pin
cjb11013-Apr-12 0:29
cjb11013-Apr-12 0:29 
AnswerRe: Correctly Disposing of MDI Child Forms. Pin
BobJanova13-Apr-12 2:37
BobJanova13-Apr-12 2:37 
GeneralRe: Correctly Disposing of MDI Child Forms. Pin
cjb11015-Apr-12 21:51
cjb11015-Apr-12 21:51 
QuestionPaging in SQL Pin
Billa212-Apr-12 20:41
Billa212-Apr-12 20:41 
AnswerCross posted from Database forum Pin
Pete O'Hanlon12-Apr-12 22:18
mvePete O'Hanlon12-Apr-12 22:18 
QuestionProjectProblem Pin
Madhavsingh12-Apr-12 19:26
Madhavsingh12-Apr-12 19:26 
AnswerRe: ProjectProblem Pin
egenis12-Apr-12 20:01
egenis12-Apr-12 20:01 
QuestionAlwaysOnTop behavior - Windows Forms vs. Win32? Pin
Ravi Bhavnani12-Apr-12 18:59
professionalRavi Bhavnani12-Apr-12 18:59 
I have an MFC desktop app that implements the "Always On Top" feature by calling:
bool bOnTop = ...
CWnd* pWndOnTop = (CWnd *) (bOnTop ? &CWnd::wndTopMost : &CWnd::wndNoTopMost);
SetWindowPos (pWndOnTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
This works as expected.  Regardless of whether or not the app is always on top of other windows, all child dialogs (both modal and modeless) are shown on top of the app's main window.

A Windows Forms version of the app attempts to do the same thing by P/Invoking SetWindowPos().  Although the app's main window responds as expected, all modal child Forms (both modal and modeless) fail to appear on top of the app's main window, and are instead occluded by the topmost main Form.  I tried setting Form.TopMostand Form.TopLevel instead of calling SetWindowPos() but am still unable to display the modal child Forms on top of the main Form.

I've Googled far and wide and have browsed both SO and MSDN to no avail.  A nudge in the right direction would be appreciated.  I'd hate to have to nix this feature because of a problem with .NET.  (I'm sure it's me and not .NET, but I'm at my wit's end.)

Thanks for any pointers you can send my way.

/ravi
My new year resolution: 2048 x 1536
Home | Articles | My .NET bits | Freeware
ravib(at)ravib(dot)com


modified 13-Apr-12 1:19am.

AnswerRe: AlwaysOnTop behavior - Windows Forms vs. Win32? Pin
Alan N12-Apr-12 23:21
Alan N12-Apr-12 23:21 
GeneralRe: AlwaysOnTop behavior - Windows Forms vs. Win32? Pin
Ravi Bhavnani13-Apr-12 5:19
professionalRavi Bhavnani13-Apr-12 5:19 
QuestionXml Serilization / Deserilization Array quesiton Pin
Jason McBurney12-Apr-12 14:09
Jason McBurney12-Apr-12 14:09 
GeneralRe: Xml Serilization / Deserilization Array quesiton Pin
BobJanova13-Apr-12 2:34
BobJanova13-Apr-12 2:34 
GeneralRe: Xml Serilization / Deserilization Array quesiton Pin
Jason McBurney13-Apr-12 5:36
Jason McBurney13-Apr-12 5:36 
QuestionDrawing to Picturebox problem. Help needed badly Pin
aquahoya12-Apr-12 13:53
aquahoya12-Apr-12 13:53 
SuggestionRe: Drawing to Picturebox problem. Help needed badly Pin
Richard MacCutchan12-Apr-12 21:25
mveRichard MacCutchan12-Apr-12 21:25 
QuestionLearning C# through exercises Pin
jeramyRR12-Apr-12 12:44
jeramyRR12-Apr-12 12:44 
AnswerRe: Learning C# through exercises Pin
Kevin Marois12-Apr-12 13:45
professionalKevin Marois12-Apr-12 13:45 
AnswerRe: Learning C# through exercises Pin
Roger Wright12-Apr-12 19:42
professionalRoger Wright12-Apr-12 19:42 
GeneralRe: Learning C# through exercises Pin
jeramyRR12-Apr-12 19:48
jeramyRR12-Apr-12 19:48 
GeneralRe: Learning C# through exercises Pin
Roger Wright19-Apr-12 8:21
professionalRoger Wright19-Apr-12 8:21 
GeneralRe: Learning C# through exercises Pin
jeramyRR19-Apr-12 8:33
jeramyRR19-Apr-12 8:33 
AnswerRe: Learning C# through exercises Pin
VJ Reddy12-Apr-12 21:03
VJ Reddy12-Apr-12 21:03 
GeneralRe: Learning C# through exercises Pin
dybs13-Apr-12 11:20
dybs13-Apr-12 11:20 
GeneralRe: Learning C# through exercises Pin
VJ Reddy13-Apr-12 13:50
VJ Reddy13-Apr-12 13:50 
QuestionRe: Learning C# through exercises Pin
Anurag Sarkar14-Apr-12 19:52
Anurag Sarkar14-Apr-12 19:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.