Thanks ill look into that modify style, looks alot better...
So needed to combine the current style with the additions.
"M. Shoaib Surya" wrote:
On Wednesday, May 14, 2008 12:42 PM Joseph M. Newcomer wrote:
See below...
On Wed, 14 May 2008 08:01:02 -0700, PRMARJORAM <PRMARJORAM@discussions.microsoft.com>
wrote:
****
(a) this is not good style for setting styles. You have cleared ALL the style bits,
EXCEPT the two you set. At the VERY MINIMUM this code should say
DWORD style = tree.GetStyle();
style |= TVS_HASLINES | TVS_LINESATROOT;
but why go through all that work? Instead, just call
tree.ModifyStyle(0, TVS_HASLINES | TVS_LINESATROOT);
which should be sufficient (no need to get the old style, etc.)
joe
****
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
On Wednesday, May 14, 2008 1:40 PM PRMARJORA wrote:
Exactly,
i was looking for a method something like SetStyle, then looking at the msdn
documentation for using CTreeCtrl, stated had to use SetWindowLong
I could not believe they had left something so fundamental out of the class
interface, they had not...
"Joseph M. Newcomer" wrote:
On Wednesday, May 14, 2008 7:52 PM David Connet wrote:
=?Utf-8?B?UFJNQVJKT1JBTQ==?= <PRMARJORAM@discussions.microsoft.com>
wrote in news:7A2A351F-F074-48AA-8D67-B0EFC1C2A298@microsoft.com:
The easiest way is to override PreCreateWindow:
BOOL CMyTreeView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= TVS_HASLINES | TVS_LINESATROOT;
return __super::PreCreateWindow(cs);
}
Some styles need to be done in OnInitialUpdate (or OnCreate)
[I just copied some listview code for an example]
GetListCtrl().SetExtendedStyle(GetListCtrl().GetExtendedStyle() |
LVS_EX_FULLROWSELECT);
Dave Connet
On Wednesday, May 14, 2008 11:39 PM Joseph M. Newcomer wrote:
They didn't. This is a documentation error, and I will add it to my list of documentation
errors.
joe
On Wed, 14 May 2008 10:40:01 -0700, PRMARJORAM <PRMARJORAM@discussions.microsoft.com>
wrote:
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm