Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Why the CTreeCtrl disable[solved]

Why the CTreeCtrl disable[solved]

Scheduled Pinned Locked Moved C / C++ / MFC
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yu jian
    wrote on last edited by
    #1

    When user click the item of the CListCtrl, I create a CTreeCtrl dynamicly to let use the data, but the CTreeCtrl is disabled, I do not know why. Is there anyone know why it is.

    L C 3 Replies Last reply
    0
    • Y yu jian

      When user click the item of the CListCtrl, I create a CTreeCtrl dynamicly to let use the data, but the CTreeCtrl is disabled, I do not know why. Is there anyone know why it is.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      yu-jian wrote:

      but the CTreeCtrl is disabled, I do not know why. Is there anyone know why it is.

      Without seeing some of your code we cannot even begin to guess what may be happening.

      One of these days I'm going to think of a really clever signature.

      Y 1 Reply Last reply
      0
      • Y yu jian

        When user click the item of the CListCtrl, I create a CTreeCtrl dynamicly to let use the data, but the CTreeCtrl is disabled, I do not know why. Is there anyone know why it is.

        C Offline
        C Offline
        chaau
        wrote on last edited by
        #3

        At least show us the code you use to create the Tree Control

        1 Reply Last reply
        0
        • L Lost User

          yu-jian wrote:

          but the CTreeCtrl is disabled, I do not know why. Is there anyone know why it is.

          Without seeing some of your code we cannot even begin to guess what may be happening.

          One of these days I'm going to think of a really clever signature.

          Y Offline
          Y Offline
          yu jian
          wrote on last edited by
          #4

          Sorry

          	CPoint point;
          	GetCursorPos(&point);
          	this->ScreenToClient(&point);
          	CRect  rect;
          	rect.top = point.y;
          	rect.left = point.x;
          	rect.right = rect.left + 200;
          	rect.bottom = rect.top  + 300;
          	
          	CComboBox\* pComboBox = new CComboBox();
          	pComboBox->Create(WS\_VISIBLE, rect, this, NULL);
          	pComboBox->ShowWindow(SW\_SHOW);
          
          	CDeviceInfoArray  arrDeviceInfo;
                        ...
          
          	 	for(int i = 0; i < arrDeviceInfo.GetCount(); ++i)
          	 	{
          	 		CString  strDevice;
          	 		strDevice.Format("%d", arrDeviceInfo\[i\]);
          	 
          	 		pComboBox->AddString(strDevice);
          	 	}
          
          D L 2 Replies Last reply
          0
          • Y yu jian

            Sorry

            	CPoint point;
            	GetCursorPos(&point);
            	this->ScreenToClient(&point);
            	CRect  rect;
            	rect.top = point.y;
            	rect.left = point.x;
            	rect.right = rect.left + 200;
            	rect.bottom = rect.top  + 300;
            	
            	CComboBox\* pComboBox = new CComboBox();
            	pComboBox->Create(WS\_VISIBLE, rect, this, NULL);
            	pComboBox->ShowWindow(SW\_SHOW);
            
            	CDeviceInfoArray  arrDeviceInfo;
                          ...
            
            	 	for(int i = 0; i < arrDeviceInfo.GetCount(); ++i)
            	 	{
            	 		CString  strDevice;
            	 		strDevice.Format("%d", arrDeviceInfo\[i\]);
            	 
            	 		pComboBox->AddString(strDevice);
            	 	}
            
            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Is your CTreeCtrl being disguised as a CComboBox? :confused:

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

            Y 1 Reply Last reply
            0
            • D David Crow

              Is your CTreeCtrl being disguised as a CComboBox? :confused:

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

              Y Offline
              Y Offline
              yu jian
              wrote on last edited by
              #6

              Firstly, I use the CTreeCtrl, but failed, then I use the CComboBox, but also failed, too. I thought that it's the same problem.

              1 Reply Last reply
              0
              • Y yu jian

                When user click the item of the CListCtrl, I create a CTreeCtrl dynamicly to let use the data, but the CTreeCtrl is disabled, I do not know why. Is there anyone know why it is.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                please show your CTreeListCtrl creation code. without seeing code how we can predict issue? ;)

                1 Reply Last reply
                0
                • Y yu jian

                  Sorry

                  	CPoint point;
                  	GetCursorPos(&point);
                  	this->ScreenToClient(&point);
                  	CRect  rect;
                  	rect.top = point.y;
                  	rect.left = point.x;
                  	rect.right = rect.left + 200;
                  	rect.bottom = rect.top  + 300;
                  	
                  	CComboBox\* pComboBox = new CComboBox();
                  	pComboBox->Create(WS\_VISIBLE, rect, this, NULL);
                  	pComboBox->ShowWindow(SW\_SHOW);
                  
                  	CDeviceInfoArray  arrDeviceInfo;
                                ...
                  
                  	 	for(int i = 0; i < arrDeviceInfo.GetCount(); ++i)
                  	 	{
                  	 		CString  strDevice;
                  	 		strDevice.Format("%d", arrDeviceInfo\[i\]);
                  	 
                  	 		pComboBox->AddString(strDevice);
                  	 	}
                  
                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  I don't know what this has to do with a tree control, but your Create() call is missing some windows styles (specifically WS_CHILD), and your control does not have an id. See the documentation[^] for more details.

                  One of these days I'm going to think of a really clever signature.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups