CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Posts
    21

    Creating topmost control on cdialog

    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...

    http://img529.imageshack.us/my.php?image=erroryt3.gif
    Last edited by aragornx; December 9th, 2008 at 08:25 AM.

  2. #2
    Join Date
    Nov 2008
    Posts
    34

    Re: Creating topmost control on cdialog

    use this may help you :

    Code:
     CListCtrl  myList;
     myList.BringWindowToTop();

  3. #3
    Join Date
    Dec 2008
    Posts
    29

    Re: Creating topmost control on cdialog

    if you are going to use SetWindowPos, then use wndTop NOT wndTopMost.

  4. #4
    Join Date
    May 2006
    Posts
    21

    Re: Creating topmost control on cdialog

    My problem still exist. Above solutions didnt'work. I tried with
    Code:
    lista.CreateEx( WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_STATICEDGE, _T("LISTBOX"), NULL, WS_CHILD | LBS_STANDARD | WS_HSCROLL | WS_VISIBLE, listRect, parentWindow,IDC_UNIT_LISTBOX );
    But it doesn't work too. I solve the problem using modal frame with my listbox - but I don't like such a workaround. Maybe someone's got the answer ?

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Creating topmost control on cdialog

    How about hiding the other windows while you're displaying your list box?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured