How to make topmost control on dialog? [modified]
-
Hi I'm creating my own control. I dynamically creating CListBox over the other controls - it's my combo list control. My problem is that controls from behind my CListBox (eg. CEdit controls) getting to front. It disturbs everything. I tried to use myList.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ) - but it's not working. Is there any way to make control topmost (something like modal dialog) over other controls. Plaese help...
modified on Tuesday, December 9, 2008 7:17 AM
-
Hi I'm creating my own control. I dynamically creating CListBox over the other controls - it's my combo list control. My problem is that controls from behind my CListBox (eg. CEdit controls) getting to front. It disturbs everything. I tried to use myList.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ) - but it's not working. Is there any way to make control topmost (something like modal dialog) over other controls. Plaese help...
modified on Tuesday, December 9, 2008 7:17 AM
I am not sure but you can have a try, You need to SetWindowPos for all the controls that intersect with your listbox. The call should be in the same order you would like to. Ex. SetWindowPos(EDIT_1) SetWindowPos(EDIT_2) SetWindowPos(LISTBOX) //Top-most.
-
Hi I'm creating my own control. I dynamically creating CListBox over the other controls - it's my combo list control. My problem is that controls from behind my CListBox (eg. CEdit controls) getting to front. It disturbs everything. I tried to use myList.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ) - but it's not working. Is there any way to make control topmost (something like modal dialog) over other controls. Plaese help...
modified on Tuesday, December 9, 2008 7:17 AM
-
I believe that wndTopMost is intended for windows (usually modeless dialog boxes) and not child indows (eg controls). Simply use wndTop and it should do the trick!
sorry - but it's not working: picture two first - wndTopMost, third - wndTop - still no solution :( some code from my control (derived form CEdit): lista - derived from (CListBox):
lista.Create( WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_HSCROLL|LBS_NOTIFY, CRect( rect.left, rect.bottom, rect.right,rect.bottom+100), parentWindow, IDC_LISTBOX ); lista.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
-
sorry - but it's not working: picture two first - wndTopMost, third - wndTop - still no solution :( some code from my control (derived form CEdit): lista - derived from (CListBox):
lista.Create( WS_CHILD|WS_VISIBLE|LBS_STANDARD|WS_HSCROLL|LBS_NOTIFY, CRect( rect.left, rect.bottom, rect.right,rect.bottom+100), parentWindow, IDC_LISTBOX ); lista.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
Hi, Did you find any solution for this finally ? I am having the same problem now. Thanks...
-
Hi I'm creating my own control. I dynamically creating CListBox over the other controls - it's my combo list control. My problem is that controls from behind my CListBox (eg. CEdit controls) getting to front. It disturbs everything. I tried to use myList.SetWindowPos( &CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ) - but it's not working. Is there any way to make control topmost (something like modal dialog) over other controls. Plaese help...
modified on Tuesday, December 9, 2008 7:17 AM