Prev: migration vc6.0 -> vc8.0
Next: Loop for AfxBeginThread
From: Lene on 4 Jun 2007 22:28 I've override the CTreeCtrl to support multi selection. Calling CTreeCtrl::SelectItem to select a new item will make other selected item unselected. So the total number of selected items always remains the same after calling SelectItem() on VISTA. It works fine on Window XP. Can anyone help on this? Thanks
From: Tom Serface on 5 Jun 2007 00:12 I've never tried doing a multiple select tree control and you didn't show any example of your code so it's tough to look at it to make suggestions, but perhaps something in this code will help: http://www.koders.com/cpp/fidC0148C6DFE5D0C4535BD17A54D241CF65205E8DE.aspx I'm not sure why Vista would make any difference, but there have been some other differences so ... This version has a sample project that I downloaded and tried on Vista and it worked OK... it might help you: http://www.codeproject.com/treectrl/EditTreeCtrl.asp?df=100&forumid=200547&exp=0&select=1956602 Tom "Lene" <Lene(a)discussions.microsoft.com> wrote in message news:4645A1F0-D173-4A62-A5A5-B93CF8C9A669(a)microsoft.com... > I've override the CTreeCtrl to support multi selection. Calling > CTreeCtrl::SelectItem to select a new item will make other selected item > unselected. So the total number of selected items always remains the same > after calling SelectItem() on VISTA. It works fine on Window XP. > Can anyone help on this? > Thanks
From: Lene on 5 Jun 2007 03:10 Thanks Tom. Steps for multi selection with CTRL key in http://www.koders.com/cpp/fidC0148C6DFE5D0C4535BD17A54D241CF65205E8DE.aspx is // Select the clicked item (this will also deselect the previous one!) SelectItem( hClickedItem ); // If the previously selected item was selected, re-select it if ( bIsSelectedItemSelected ) SetItemState( hSelectedItem, TVIS_SELECTED, TVIS_SELECTED ); my steps is: // make the tree ctrl think there is no selection SelectItem (NULL); // and keep the the previously item selected SetItemState( hSelectedItem, TVIS_SELECTED, TVIS_SELECTED ); // then Select the clicked item SelectItem( hClickedItem ); It works fine with XP. But the hSelectedItem will be unselected on VISTA. Thanks "Tom Serface" wrote: > I've never tried doing a multiple select tree control and you didn't show > any example of your code so it's tough to look at it to make suggestions, > but perhaps something in this code will help: > > http://www.koders.com/cpp/fidC0148C6DFE5D0C4535BD17A54D241CF65205E8DE.aspx > > I'm not sure why Vista would make any difference, but there have been some > other differences so ... > > This version has a sample project that I downloaded and tried on Vista and > it worked OK... it might help you: > > http://www.codeproject.com/treectrl/EditTreeCtrl.asp?df=100&forumid=200547&exp=0&select=1956602 > > Tom > > > > "Lene" <Lene(a)discussions.microsoft.com> wrote in message > news:4645A1F0-D173-4A62-A5A5-B93CF8C9A669(a)microsoft.com... > > I've override the CTreeCtrl to support multi selection. Calling > > CTreeCtrl::SelectItem to select a new item will make other selected item > > unselected. So the total number of selected items always remains the same > > after calling SelectItem() on VISTA. It works fine on Window XP. > > Can anyone help on this? > > Thanks >
From: Lene on 5 Jun 2007 03:10 Thanks Tom. Steps for multi selection with CTRL key in http://www.koders.com/cpp/fidC0148C6DFE5D0C4535BD17A54D241CF65205E8DE.aspx is // Select the clicked item (this will also deselect the previous one!) SelectItem( hClickedItem ); // If the previously selected item was selected, re-select it if ( bIsSelectedItemSelected ) SetItemState( hSelectedItem, TVIS_SELECTED, TVIS_SELECTED ); my steps is: // make the tree ctrl think there is no selection SelectItem (NULL); // and keep the the previously item selected SetItemState( hSelectedItem, TVIS_SELECTED, TVIS_SELECTED ); // then Select the clicked item SelectItem( hClickedItem ); It works fine with XP. But the hSelectedItem will be unselected on VISTA. Thanks "Tom Serface" wrote: > I've never tried doing a multiple select tree control and you didn't show > any example of your code so it's tough to look at it to make suggestions, > but perhaps something in this code will help: > > http://www.koders.com/cpp/fidC0148C6DFE5D0C4535BD17A54D241CF65205E8DE.aspx > > I'm not sure why Vista would make any difference, but there have been some > other differences so ... > > This version has a sample project that I downloaded and tried on Vista and > it worked OK... it might help you: > > http://www.codeproject.com/treectrl/EditTreeCtrl.asp?df=100&forumid=200547&exp=0&select=1956602 > > Tom > > > > "Lene" <Lene(a)discussions.microsoft.com> wrote in message > news:4645A1F0-D173-4A62-A5A5-B93CF8C9A669(a)microsoft.com... > > I've override the CTreeCtrl to support multi selection. Calling > > CTreeCtrl::SelectItem to select a new item will make other selected item > > unselected. So the total number of selected items always remains the same > > after calling SelectItem() on VISTA. It works fine on Window XP. > > Can anyone help on this? > > Thanks >
|
Pages: 1 Prev: migration vc6.0 -> vc8.0 Next: Loop for AfxBeginThread |