selection in CTreeCtrl

Hello,



I have a Tree Control in my application that displays two types of items:
type A and type B.



I want to implement the following:



1. When user clicks on any item of type A it should be shown as selected and
the previously selected item will be deselected - it is actually the default
behavior.

2. When user clicks on any item of type B - nothing should happen: the
previously selected item remain selected and the clicked item remains
deselected. So, actually, I want that the items of type B will never
highlighted with a blue band.



How can do it?



Thanks,

Mark.



 --

Please reply to th enewsgroup or remove '.nospam.' my email address.


0
mfine (9)
8/18/2003 9:07:02 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
1028 Views

Similar Articles

[PageSpeed] 57

Thanks, Vladimir.



I will try this.



Regards,

Mark.



"Vladimir Khvostov" <vladimir@donotspammkhvostov.com> wrote in message
news:uBpagNdZDHA.2352@TK2MSFTNGP12.phx.gbl...
> Mark,
> you can try the following:
> Create an event handler for TVN_SELCHANGING notification. Class wizard
> will generate something like:
>
> void CDlgTestDlg::OnSelchangingTree1(NMHDR* pNMHDR, LRESULT* pResult)
> {
>       NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
>      *pResult = 0;
> }
>
> Change it to:
>
> void CDlgTestDlg::OnSelchangingTree1(NMHDR* pNMHDR, LRESULT* pResult)
> {
>       NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
>      *pResult = IsBNode(pNMTreeView->itemNew.hItem);
> }
>
> Good luck,
> -- Vladimir
> Mark Fine wrote:
>
> > Hello,
> >
> >
> >
> > I have a Tree Control in my application that displays two types of
items:
> > type A and type B.
> >
> >
> >
> > I want to implement the following:
> >
> >
> >
> > 1. When user clicks on any item of type A it should be shown as selected
and
> > the previously selected item will be deselected - it is actually the
default
> > behavior.
> >
> > 2. When user clicks on any item of type B - nothing should happen: the
> > previously selected item remain selected and the clicked item remains
> > deselected. So, actually, I want that the items of type B will never
> > highlighted with a blue band.
> >
> >
> >
> > How can do it?
> >
> >
> >
> > Thanks,
> >
> > Mark.
> >
> >
> >
> >  --
> >
> > Please reply to th enewsgroup or remove '.nospam.' my email address.
> >
> >
>


0
mfine (9)
8/19/2003 1:18:58 PM
Reply:

Similar Artilces:

CEdit selection focus
I need to implement something like a find/replace dialog. So I select the text in the CEdit and then bring up a dialog to ask the user what to do with the selection. The problem is that the selection in the CEdit is only visible when the CEdit has the focus. Since the dialog steals the focus, the selection is not visible and the user does not know what (s)he is being asked about. How can I keep the focus on the CEdit (or keep the selection visible) while asking the user for input? On Jan 23, 11:53=A0am, Alexander <the44s...@yahoo.com> wrote: > I need to implement something like a f...

Sync selective folder in Cached Exchange Mode
Hi, I have a PC which runs in Cached Exchange mode and it syncs all folder (which is what I want) I have a second PC on which I would like to sync only selective folders, namely Calendar and Contacts. The trouble appears to be that in Cached Exchange Mode, sync settings (e.g. send/receive groups) appears irrelevant. Outlook syncs everything regardless. How can I run in cached Exchange Mode just syncing Calendar and Contacts? Thanks, Chris ...

How to access data in a CTreeCtrl with a TVN_SELCHANGED event?
I have a property panel (CMFCPropertyGridCtrl) and a tree view (CTreeCtrl ) in my MFC app. I have captured TVN_SELCHANGED event in my own CFrameWndEx class ( called CMainFrame ) and I want to access to the item selected data. I want to update the property panel with the item data. In CMainFrame I got access to the CTreeCtrl object and the CMFCPropertyGridCtrl object. What shoud I do to access the according tree item? I think I must cast NMHDR to another structure on the event handler, maybe NMTVITEMCHANGE? and get an item ID, but I don't know what to do with it. Thanks. "R...

Can't Select Main Form
My db is a Access 2007 converted from 2003. I'm attempting to change all my forms with split forms which oesn't require much. But, at times I'm unable to close my Main form (which is more or less a switchboard) which I created. This occurs after I close a form I opened from the main form click the caption's close button on the main form and nothing happens. The button doesn't even change color to indicate you are over it. Also, at times, when I am able to close the main form I'm unable to select anything in the navigation pane. I am however able to select and use ever...

File Selection and New file names
Question #1: When in the "Open File" dialog box of Publish 2002, the CTL and SHIFT keys do not work to select multiple files. This works in Word 2002 and Excel 2002 and also worked in Publish 2000. Is there a setting to allow this? Question #2: How do you get Publish 2002 to return to the folder of the "last" file opened when opening another file? Sometimes it returns to "My Docs", other times to the last folder (within my Docs) with apparently no logic, mostly returning to My Docs. Comment: Same as AB24U's message 1-24-05. When started using Pub...

Revalue: Currency not listed to select
I am trying to use the revalue feature for multicurrency. When I try to revalue (Tools>Routines>Financial>Revalue), there is no currency listed as available to revalue. I have confirmed that the currency is set up correctly, active, that all companies have access to, and there is a valid exchange rate setup. I have also confirmed that all accounts have been granted access to the currency. The currency is working in all other aspects; just not showing up as an option to be revalued. Any suggestions/help would be most appreciated. Thanks, Erica Just wanted to post our resolution. ...

Selection too large
I am using copy and fill down as part of a macro and am receiving this error message. Can someone tell me what I am doing wrong? This macro was working fine all day yesterday. TIA I've never seen this message, but it sounds like your selection is too large <vbg>. Does your macro copy/fill multiple columns down? If yes, maybe you could do it with fewer columns (one column at a time????). Brian wrote: > > I am using copy and fill down as part of a macro and am > receiving this error message. Can someone tell me what I > am doing wrong? This macro was worki...

<Select sheet> window
On opening one of my xls (2000) files - call it A.xls - I get a window <Select sheet to link to> offering a list of worksheets in the another xls file - call it B.xls. Presumably some entry in A.xls is generating this message, but I'm unable to find it by searching all worksheets for B.xls. Suggestions gratefully received. It is about eight years since I used it so I cannot recall full operation but, you might try Bill Manville's Findlink.xla http://www.oaltd.co.uk/MVP/MVPPage.asp -- Steve "Bagwash" <bagwash@ntlworld.com> wrote in message news:MAnhl...

XML to DataSet please help with selection
I have a two xml files schema is identical. When I read file into dataset and then bind dataset to the form. These are weather files we are getting from weather service. One file has only local weather so I don't have any problems with that, but other has weather for several different locations. Basically I need to select only weather for location if I know its code. I should have exactly same dataset so I will be able bind it to the same form without recoding. I was trying to use dataview, but dataview works only with one table and doesn't produce dataset. I got it working by ...

Need help with selecting a range of data for a function.
Hi There, I have the problem that I have large files with data from which I need to select a section based on their values. I have one column with date and time and one column with values. I need excel to prompt for a start date and time and end date and time via a macro or built in function (VBS?). I then need excel to perform all calculations based on the range it has to pick based on the dates and times ... I can not figure out how to to this sort of addressing :( Any help is appreciated! Matt ...

CEdit as a CTreeCtrl Item
Hi, I want to make an application consists of CTreeCtrl with an CEdit as one of its Item. The purpose is to display the CEdit as CTreeCtrl item not to edit the Item label, so it is definitely must be shown. How is the idea / concept / steps to do that? Any help is ok. Thank you very much.. CTreeCtrl lets you edit the item. If you dont want it, why would you want a CEdit as an Item? Whats the purpose of it? --- Ajay "Landon" <Landon@discussions.microsoft.com> wrote in message news:F4831533-BE82-43B2-81C5-F0EF87A078FD@microsoft.com... > Hi, I want to make an appli...

Excel
Please Help! I created a document, selected Protection>Protect Sheet, then made it shared document. My problem is now the �Unprotect Sheet� selection i grayed out and I need to make some changes. I am also unable t unshare the sheet. I would appreciate any info on the issue. Thanks in advance, Ada -- Message posted from http://www.ExcelForum.com Why 3 posts in 4 minutes? You have to unshare the workbook. That's the only way to change protection. -- Jim Rech Excel MVP "abailey >" <<abailey.19t5an@excelforum-nospam.com> wrote in message news:abailey.19t...

Show sum based on selection from Combo Box
I have a form, on the form there are 4 combo boxes for selection and the result are showed in a subform. I created a table (tblHours_worked) that contain the number of hours worked by each in employee. Now based on the selection from the combo box(s) how do I get the total hours worked to calculate and show in a field on the main form? Hopefully, this makes sense. -- tmdrake Add the textbox to the main form, I'm going to call it txtHourSum. For the control source for the txtHourSum put in something like this: =3DDSum("WorkHours","tblHours_worked", "Employ...

Populating text box based on selection in two combo boxes
I have a form that contains two combo boxes that are related to each other. I need to find a way to populate my text box based on the criteria of the two combo boxes so the appropriate number appears in the text box. I created a DLookup Function that works when I run it using Query designer but when I add it to the Control Source of my text box it returns nothing. I'm not sure if this is because the second combo box values are based on the selection made from the first comb box. On Wed, 10 Oct 2007 17:12:55 GMT, "SHAWTY721" <u38136@uwe> wrote: >I have a form that cont...

Email Help: Select a Voting button custom option when sending resp
Hi All, How do I select a custom option (persent under voting buttons section) while sending an email with voting buttons. There is a custom option "Have replies sent to" under voting buttons section that I want to be checked automatically every time a voting email is sent. For eg: Person1: sends an email to Person2 and Person3 for their votes Person2: votes and the voting reply is sent to Person1 and Person3 Person3: votes and the voting reply is send to Person1 and Person2 Is this possible? Thanks in advance ...

SELECT INVERSE
I want to know about how to give inverse selection ...

Selection not updating in CSliderCtrl
I am using a CSliderCtrl with the selection range enabled. I'm calling SetSelection(min, max) to set the range, but the control does not immediately update to show the new range. However, clicking the slider knob (thumb?) does cause the range to update. How do I force the range to update programatically? TIA. ...

Selecting more than one value from a list or combo box
Does anyone know how to allow a user to select more than one value from a list or combo box? Thanks -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200710/1 You cannot select more than one value from a combo box, but you can for a listbox. Set the MultiSelect property to either "Simple" or "Extended". Simple means that you click an item to select it and click it again to unselect it. Extended makes the selection behave like a Windows Explorer list - ctrl-click to select multiple items, or click then shift-cl...

select a specific ActiveCell by VBA
In any cell in column "F", a user can select a code number from a drop down list. These numbers go up to over 100, so, if the user isn't sure of which number to select, cell F6 can be rightclicked and VBA will take the user to a different sheet where all the code numbers (and their associated meanings) are listed. A command button on that sheet will take the user back to the ActiveCell on the first sheet. Even if the user was working in cell F2000, the active cell is now always F6 To get around this, how can I set the active row to the bottom most row with data i...

IF to SELECT CASE
Instead of having this IF statement =IF(A1=DATEVALUE("1/1/04"),"NEW YEAR'S",IF(A1=DATEVALUE("1/19/04"),"MLK DAY","") I would rather have a SELECT CASE statement. How do I do that? In particular, how do I reference the date cell Thanks Howar try select case range("a1") -- Don Guillett SalesAid Software donaldb@281.com "Howard" <anonymous@discussions.microsoft.com> wrote in message news:E48C3D5A-DC6F-433B-B049-040066CAA4AF@microsoft.com... > Instead of having this IF statement: > =IF(A1=DATEVALUE("1/...

select X
If I select columns A, C, and E to chart, how can I select column C to be the X axis? -- Bryan Kelly Time is the medium we use to express out priorities. In Step 2 of the chart wizard; open the Series tab. Edit the data so that the X-vales are your required vales in C -- Bernard Liengme www.stfx.ca/people/bliengme remove CAPS in e-mail address "Bryan Kelly" <noone@nowhere.com> wrote in message news:%CUbc.383722$B81.5855961@twister.tampabay.rr.com... > If I select columns A, C, and E to chart, how can I select column C to be > the X axis? > > -- > Bryan Ke...

sort by name when user selects name on another worksheet
Is there any want to select a value on one worksheet, using a pick list, and having that sort data by the name on another sheet? For example in a sheet named “Start Here” Cell B3 has a pick list with names in it, like Joe, bill, bob, henry etc. If the user selects Joe on that worksheet, then another worksheet named “Employees Info 2-25-10” is sorted by that name, i.e. Joe? Is this possible, if so how? Any help would be appreciated! I think that you mean data filtered rather than sorted? In other words, when you select "Joe" on the Start Here sheet, then the Emplo...

Indicating selected cell
I have a worksheet set up with borders around the cells and when the cell is selected, it just shows a thin double line around 3 sides of the cell selected so it is hard to tell which cell is selected. Is there a way to shade or display the selected cell in a different color? LGuest, Try this out: http://www.cpearson.com/excel/RowLiner.htm John "LGuest" <LGBeach8@yahoo.com> wrote in message news:142201c3e031$0047f140$a301280a@phx.gbl... > I have a worksheet set up with borders around the cells > and when the cell is selected, it just shows a thin double > lin...

Query and date selection
I test to see if a reservation begins between 11/15-3/31 of any year. So far I have come up with, for the reservation begin date: Between #11/15/2009# And #12/31/2009# Or Between #1/1/2009# And #3/31/2009# This, of course, only tests for 2009. Can I use a year wildcard? Is there a better way? Thanks in advance, -- Chrissy Add Another Field to your query, something like this: monthdayfield: Format([ReservationDate], "mm/dd") And then for the criteria: >="11/15" or <="03/31" I think that will do the trick. You can try a ...

DLookup (populating text based on other selections on form)
Hi All, I have searched a few posts and still having trouble with this easy (hopefully) fix. I have a form called "Form_Update_Individual_Goal". On this form are a few combo boxes (Quarter, Year, VP Name, Director Name, Manager Name, Associates Name and Goal). Each of these are based on a table called "Individual_Goals_Input: All Items". On this table is the above combo boxes plus a field I want to bring down to a text box called "Measure" So Ideally, what i want to do is the following: Person Selects on form: Quarter: Q1 Year: 2010 VP Name: Hap...