Why the CTreeCtrl disable[solved]
-
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.
-
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.
-
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.
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); }
-
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); }
Is your
CTreeCtrl
being disguised as aCComboBox
? :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
-
Is your
CTreeCtrl
being disguised as aCComboBox
? :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
-
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.
-
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); }
I don't know what this has to do with a tree control, but your
Create()
call is missing some windows styles (specificallyWS_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.