Thread: Tree View control not appearing

  1. #1
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584

    Tree View control not appearing

    In my program, I am using a Tree View control. Well, I thought I did everything that is needed to just show the Tree View (I have not coded to actually add elements yet, but I just want to see that the control was created properly). But it turns out that the Tree View doesn't show on the dialog. Any help? Here's the situation. The window calls a dialog, and on this dialog, I want to create the Tree View control. But, it is not so, because I don't see the Tree View control. Here is the code:

    Code:
    case WM_SIZE:
                cxChar = LOWORD(GetDialogBaseUnits());
                cyChar = HIWORD(GetDialogBaseUnits());
                cxClient = LOWORD(lParam);
                cyClient = HIWORD(lParam);
    
                
                hwndAutoTree = CreateWindow(WC_TREEVIEW, TEXT(""),
                                    WS_VISIBLE | WS_CHILD | WS_TABSTOP |
                                    TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS,
                                    cxClient - 124, 4, 120, cyClient - 8,
                                    hDlg, NULL, hInst, NULL);
    
                return TRUE;
    This is all the Tree View code so far, it is all within the WM_SIZE message. I thought this would be enough to just show the Tree View so I can see if it exists. Any ideas on how to fix this? Do you need to see more code?

    Thanks!
    1978 Silver Anniversary Corvette

  2. #2
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Hmm, did you call InitCommonControls() before creating the Tree View control?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Tree View Control flickering
    By cfriend in forum Windows Programming
    Replies: 1
    Last Post: 09-13-2004, 09:25 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM