Skip to main content
GameDev.net gamedev.net
🔒 Locked

creating a tree control

Started by Emexus Feb 21, 2005 at 4:06 PM 1 replies 950+ views
Original Post
Emexus
Emexus
Hi, i seem to be having some trouble creating a tree control in my application is this the correct way to declare it?

hTree = CreateWindowEx(WS_EX_CLIENTEDGE, "SysTreeView32", "", 
		       TVS_NOSCROLL | WS_BORDER | WS_TABSTOP,
		       0, 0, 120, 600, hWnd, 
		      (HMENU)IDC_TREE, 
		      GetModuleHandle(NULL), NULL);


cheers
LessBread
LessBread
Looks ok to me. Are you getting an error? Is hTree NULL? If so what does GetLastError return?

Try oring 0x1e0f with the WS_ styles, eg: 0x1e0f | WS_BORDER | WS_TABSTOP. Also try oring with WS_VISIBLE. Try using 0 instead of WS_EX_CLIENTEDGE.



"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Emexus
Emexus
cheers for the help ive got it working using this code:

hTree = CreateWindowEx(0L, WC_TREEVIEW, "", 		       WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASBUTTONS |                       TVS_HASLINES | TVS_LINESATROOT | 		       TVS_EDITLABELS | TVS_TRACKSELECT | TVS_SINGLEEXPAND | 		       TVS_INFOTIP | TVS_FULLROWSELECT |                        WS_BORDER | WS_TABSTOP,		       0, 0, 120, 600, hWnd, 		       (HMENU)IDC_TREE, 		       GetModuleHandle(NULL), NULL);	

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.