CTreeCtrl move + button to the right

Hello everybody,

I created a CTreeCtrl and I'd like to move the expand button to the
right.

here's my code
CTreeCtrl tree;
tree->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP |
                             TVS_HASLINES | TVS_HASBUTTONS |
TVS_LINESATROOT |
                         TVS_SINGLEEXPAND | TVS_SHOWSELALWAYS |
                         TVS_TRACKSELECT,
                             CRect(10, 10, 200, 240), this, 0x1221);

        HTREEITEM hTree, hText;

        hTree = tree->InsertItem("Root", TVI_ROOT);

        hCompany = tree->InsertItem("Item 1", hTree);
        tree->InsertItem("SubItem 1", hText);
        tree->InsertItem("SubItem 2", hText);
        tree->InsertItem("SubItem 3", hText);

but with this code the expand button appears at the right. Is it
possible to move the expand button to the right that it looks like
this:

Root -             Normally it looks like this:  - Root
  Item 1 +                                          + Item 1

I have no idea how to move the +/- expand button to the right, so that
it appears at the right of the text and not at the left of the text.

Thanks in Advance

cu fakie

0
5/13/2006 7:41:11 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
1098 Views

Similar Articles

[PageSpeed] 7

hans_fakie@yahoo.com wrote:
> Hello everybody,
>
> I created a CTreeCtrl and I'd like to move the expand
> button to the right.
> [...]
> Is it possible to move the expand button to the
> right that it looks like this:
>
> Root -             Normally it looks like this:  - Root
>  Item 1 +                                          + Item
>
> I have no idea how to move the +/- expand button to the
> right, so that it appears at the right of the text and
> not at the left of the text.

You can't just move expand button from left to right. Just 
imagine what would have been happened if you could. How 
would you connect expand buttons on different levels of a 
tree control? What you can do is to mirror tree control 
layout. So, instead of regular LTR layout

    +-------------
    | [-] Root
    |    [+] Item

you will get mirrored RTL layout:

    -------------+
        Root [-] |
     Item [+]    |

You will need to create tree control with WS_EX_LAYOUTRTL 
extended style. Also, you will need to observe several other 
rules concerning RTL. For more info look here:

"Window Features"
http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowfeatures.asp

Read section "Window Layout and Mirroring".

HTH
Alex 


0
5/14/2006 5:21:08 PM
This does not make a whole lot of sense. This functionality is not available
by default in tree control. You can try by custom drawing (NM_CUSTOMDRAW)
but I very much doubt about its success. You are better off writing the
whole control yourself. Keep in mind this is going to stand out(for better
or worse) as this is not common.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


<hans_fakie@yahoo.com> wrote in message
news:1147506071.340463.86920@i40g2000cwc.googlegroups.com...
> Hello everybody,
>
> I created a CTreeCtrl and I'd like to move the expand button to the
> right.
>
> here's my code
> CTreeCtrl tree;
> tree->Create(WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP |
>                              TVS_HASLINES | TVS_HASBUTTONS |
> TVS_LINESATROOT |
>                          TVS_SINGLEEXPAND | TVS_SHOWSELALWAYS |
>                          TVS_TRACKSELECT,
>                              CRect(10, 10, 200, 240), this, 0x1221);
>
>         HTREEITEM hTree, hText;
>
>         hTree = tree->InsertItem("Root", TVI_ROOT);
>
>         hCompany = tree->InsertItem("Item 1", hTree);
>         tree->InsertItem("SubItem 1", hText);
>         tree->InsertItem("SubItem 2", hText);
>         tree->InsertItem("SubItem 3", hText);
>
> but with this code the expand button appears at the right. Is it
> possible to move the expand button to the right that it looks like
> this:
>
> Root -             Normally it looks like this:  - Root
>   Item 1 +                                          + Item 1
>
> I have no idea how to move the +/- expand button to the right, so that
> it appears at the right of the text and not at the left of the text.
>
> Thanks in Advance
>
> cu fakie
>


0
ajaykalra (6842)
5/15/2006 3:38:35 AM
Hi,

I drawed the whole control, so it's working.
Thx for your help.

cu lamine

0
5/17/2006 4:57:43 AM
Reply:

Similar Artilces:

Unhiding/Hiding right click options
I wanted to copy a sheet from an excel file and paste to another file. The problem is, when I right click on the sheet name, the option for "Move or Copy..." has been greyed out. Is this because the sheet has been protected? ... How can I do this type of protection for spreadsheets I create? ... Where only certain functions are greyed out... Thanks! ... LavaDude If you protect the workbook, you can see this option greyed out. Tools|Protect|Protect workbook Is how you would set it. If you see "Tools|Protect|unprotect workbook", then it is protected. You may...

Gaining exclusive rights to folders and files
Hello, I'm currently using a program called unlocker that I'm using to keep files that I need to move around etc.. from being locked while I'm doing those operations. I need a way to do that in powershell without using a 3rd party tool. Does anyone know a way, in powershell, to gain exclusive rights to folders and all the files in those folders? Thanks, Stu this doesnt look easy.. why are you looking the file? there is a win32 function for that http://msdn.microsoft.com/en-us/library/aa365202(VS.85).aspx no idea how you'd do this, but its the only func...

Contacts Button on New Message
Outlook 2002 sp2 on Win XP Pro After opening a new message form, clicking the To button opens the select names feature. Trying to type in the find box, or selecting by highlighting causes the window to freeze. The only way to unfreeze the select names window is through ctl alt del. I can open the contacts shortcut, highlight a contact, right click and select new message. I have opened and closed the program and rebooted without any change. I do not get an error message when this happens. Jerry Have you tried Detect and Repair? --� Milly Staples [MVP - Outlook] Post all replie...

command buttons not showing with projector
Hi, I had a complaint from a client that the command buttons we created do not show when he tried to demonstrate the Excel application using a projector (i.e. like InFocus) . He could see them on his laptop screen and they worked but they did now show on the projector screen. He is using Excel 2002. Anyone see this happen? Thanks, Terry ...

MDI minimize maximize and close buttons
In MDI there are mini sys menu for each view (or mdichildwnd). When I press the specific view sys menu button (min, max or close) which message is being sent and to which class ? 10x, J. I think you are looking for OnSysCommand. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Janiv Ratson" <janiv@aoe6.net> wrote in message news:uyfBStL5DHA.1672@TK2MSFTNGP12.phx.gbl... | In MDI there are mini sys menu for each view (or mdichildwnd). | When I press the specific view sys menu button (min, max or close) which | message is being sent and to which class ? | 10x, | J. | | ...

Back button doesn't work in Windows 7
New computer loaded with Windows 7. The back button doesn't work most of the time. Fix? Thanks, Rick Morrison "Rick Morrison" <rlmorrison@earthlink.net> wrote in message news:IamdnTxlp9BhAcjWnZ2dnUVZ_uqdnZ2d@giganews.com... > New computer loaded with Windows 7. The back button doesn't work most of > the time. Fix? Back button works fine on Windows 7 on my home PC. What 3rd party toolbars have you got loaded? Google? Yahoo? Anything else? The only time the back button doesn't seem to work is when there is an intermediate redi...

How to create a pure text button toolbar?
I want to create a toolbar. On which, there is only text (no image) on its button. I call SetButtonInfo() with iImage=-1. It take effect, but there are still a blank block on the button. Thank you very much. You have to destroy the imagelist(s) corresponding to the toolbar. There was excellent sample by Paul Dilascia in MSJ/MSDN few years back where he showed how to replace a menu by a toolbar in an MDI application. A search on MSDN's site for that sample would be helpful. In addition, look at codeguru/codeproject for some sample on this. I am sure something must be there as well. ----...

Protect Sheet not allowing insert or delete rows. VBA buttons not solving problem ?
I created a spreadsheet, and I used protection-->protect worksheet to prevent users from deleting the heading section that exists above the rows that follow. I also put a password in. I want the user to be able to insert or delete rows below the headings where they enter data, but this is being prevented by Excel since I set protect worksheet with a password. If I set protect worksheet without using a password, it works great. I coded 2-buttons for insert and delete in hopes of getting around this problem. But the password pops up when I hit a button attempting to insert or delete. By the...

Macro to move file
Is there a way to use a macro in a workbook to move a file from one folder to another folder by copying it? I tried to record a macro to do it but nothing shows up in the VB editor. Thanks Dave Hi Dave Try the following? Sub SaveCopy() ChDir "C:\Documents and Settings\{Enter new Directory name here}" ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\{Enter new directory and file name here}, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub This is th...

Move Category in Money 2003
Is there any way to move an existing category to make it a sub-category of another existing category ? TIA Serena So basically you can't do it. You can only move the transactions within the category to a new sub-category of the same name. I'm sure older versions of Money allowed you just to select the category to move and then select the master category to attach it to from a list instead of having to type the whole category name ! Thanks for you help anyway. What do you mean "you can't do it"??? If you want to move every transaction in subcategory Miscellane...

Moving Exchange Folders
I'm looking for the proper way to move the ExchangeServer_<servername> folder to a different drive. I've successfully moved mail stores, message tracking logs, MTA and SMTP queues but can't find any info about moving this folder. It is the Full Text Indexing database which I don't use, but the Server is clustered so there are some files called clust0.0 clust0.1 etc in there which seem to update every once in a while. Anyone know how to move this folder properly? Moveing these files is not intuitive, but it can be done. Follow the Microsoft article http://support.mi...

Permissions problem after move mailbox Exchange 5.5 to 2003
I have been working on moving mailboxes from my Exchange 5.5 server to our Exchange 2003 server. The process has been working well - over the past five months I have moved approx 200 mailboxes with no problem. Yesterday I decided to move some additional mailboxes. I received no errors whatsoever, but today those users are having problems accessing certain mailbox folders. I am testing with one user and I am able to export items to a pst, but every time I click on certain folders or try to select mailbox properties, I get completely thrown out of Outlook - event ID 1000 is generated ...

Moved priv databases and can't access Calendar Items from outlook??
I was running out of HD space so I went in to the Exchange console and moved the private databases to another drive per instructions in a KB article. Everything seems to have worked out okay, but now I cannot open my calendar items or accept any invitations sent to me. Anyone have any ideas on this? "Sterling" <Sterling_Jacobson@RemoveMeHotmail.com> wrote: >I was running out of HD space so I went in to the Exchange console and moved >the private databases to another drive per instructions in a KB article. > >Everything seems to have worked out okay, but no...

moving contents
Is there any way to move mutliple cells from one column to another column without having to grab each individual cell. i.e. I want to move every forth cell in my A column (A1,A5,A9,A13 etc.) and place them into my B column (B1,B5,B9,B13 etc.) I'm dealing with over 2000 rows and it would take me too much time to do each individually. Thanks. You could use a macro to move the data (try this on a backup copy of the data): Sub MoveValues() Dim c As Range For Each c In Sheets("Data").Range("A1:A2000") If c.Row Mod 4 = 1 Then c.Offset(0, 1).Value = c.Value c....

Command Buttons Dont Work In Dialog Box If Placed Infront Of A Picture Or Drawing Box
Now This Ones Got Me Quite Stumped! I have quite a large spreadsheet with approximately 100 sheets, al performing diferent actions. As a result, to make navigation easier I have created a simple men system using a dialog box. However the dialog box (with its defaul greyish colour) does not look very good. So I thought of placing som blocks of colour behind the control buttons. This way I was able t categorise groups of the control buttons into nice looking coloure blocks. The problem I have is that even though the dialog box looks ver pleasing and proffesional, having the cloured blocks be...

move mailbox keeps repeating the move
I am attempting to move a mailbox from my microsoft exchange 5.5 server to my brand new microsoft exchange 2003 server. The move starts off nice enough but when it gets to about 30% it restarts the move over again. The mailbox is rather large (5.6 gigs total size). I am wondering if Exchange 2003 just can't handle this size or if there is something else wrong with the transfer. Does it actually fail or are you killing it? Errors in the Event Logs? On Sat, 14 Aug 2004 12:01:51 -0700, Jason Gallas <nospam@usenetserver.com> wrote: >I am attempting to move a mailbox from my mi...

2K3 Move Mailboxes Without Ex Admin Privs
Is it possible to move mailboxes without giving Exchange Administrator privlages and/or the ability to open mailboxes? Basicly, I need to allow my help desk to move mailboxes, without giving the ability to open them. On Mon, 18 Apr 2005 10:15:03 -0700, "Peter2003EXAD" <Peter2003EXAD@discussions.microsoft.com> wrote: >Is it possible to move mailboxes without giving Exchange Administrator >privlages and/or the ability to open mailboxes? > >Basicly, I need to allow my help desk to move mailboxes, without giving the >ability to open them. Certainly. See:...

Changed View to right and lost info on left
changed pane view from bottom to right and lost info on left of view ie mail ect. How do I get it back. "=?Utf-8?B?TWFpbCxDYWxlbmRhciwgQ29udGFjdHMsVGFza3M=?=" <Mail,Calendar, Contacts,Tasks@discussions.microsoft.com> wrote in news:A5E3C498-0C5E-4593-9CE8-84E6419CB47C@microsoft.com: > changed pane view from bottom to right and lost info on left of view > ie mail ect. How do I get it back. What if you grab the left side of the reading pane and drag it to the right to resize it? -- Aloha, -Ben- Ben M. Schorr, OneNote-MVP Stockholm Consulting Gro...

New to RMS, moving systems onto a domain
I am moving 3 POS systems onto a domain for a client. The computers are currently on a workgroup. I don't know anything about what type of database RMS uses (is it access, SQL, something else?), what profile settings are required, etc... Can I simply use the windows XP settings transfer wizard to transfer the user's current workgroup profile onto a new profile that I setup once joined to the domain? Also, I want to move the database itself onto the new file server. Where in RMS do you set the path for the database? Is it just a file or set of files I can move to a share ...

Frustration Moving OE6 addresses to Outlook 2003
Very Frustrated I'm still unable to get my OE6 addresses into Outlook 2003 on a Windows XP machine. It looks like it should be a no brainer I've tried three ways as below =96 none worked. 1. In Outlook a. Click Import/Export, Mail, Addresses, Rules b. Click Addresses c. Click OE6 Result =96 =930 addresses imported=94 2. In OE6 a. Click File | Export | Address Book b. Select Text file | Export c. Save File as c:\addresses.csv d. Export, Save Next e. Check off desired fields f. Finish Result =93Error Exporting the Address Book=94 3. In OE6 a. C...

How to move Win7 to 1st partition ?
I have installed Win7 64bit on my third (last) partition, because I did not want to update Vista 32 bit. Of course it works well. But still I would like to move Win7 to the first partition, and maybe restore Vista 32 bit to the third partition. I have moved it : it did not work. I restored from a Norton Ghost restore point, and it still will not boot. Repair from the Win7 install DVD cannot fix it. Can it be done ? "Nat�ag" <cquimoi@vide.com> wrote: >I have installed Win7 64bit on my third (last) partition, because > I did not want to update Vista 3...

Moving the Exchange Virtual Directory
How do I move the Exchange Virtual Directory from the Default Website to another website I create?? Do I have to delete the virtual directory from my exchange administratro first? Kevin "cst112" <cst112no-spam-please@yahoo.com> wrote: >How do I move the Exchange Virtual Directory from the Default Website to >another website I create?? Do I have to delete the virtual directory from >my exchange administratro first? > >Kevin > 5.5 http://support.microsoft.com/?kbid=246203 2K http://www.dalantech.com/boards/showflat-Cat--Number-55984-page-6-view-collapsed-...

Moving new emails?
This is a multi-part message in MIME format. ------=_NextPart_000_0010_01C41BBF.72EEC290 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable For some reason, when I opened Outlook today, it automatically moves one = certain email to deleted items. The email isn't on my junk mail or = adult senders lists, and there's no rule stating to move it. I've = always received this person's email with no problems before. Any ideas? --=20 Joy Hutchins joyhutchins@email.uophx.edu jhutchins@gawronturgeon.com ------=_NextPart_000_0010_0...

How to "crop" charts created in Excel and moved to Word
Does anyone know if I can "crop" an Excel chart which has been imported into Word. This is possible for pictures but I can't seem to do it for a chart. I'm using Office 2007 If you paste the chart as a picture, you can crop the picture of the chart. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Jim" <Jim@discussions.microsoft.com> wrote in message news:663604AC-82C4-4257-940F-E3A73A56CC83@microsoft.com... > Does anyone know if I can "crop" an ...

Common Button for two property pages
PropertySheet has 2 property pages. I want to add a button which will appear when the user makes either of the pages active. The button needs to appear for both and has to be common. How do I do it? Depends upon what you mean by common button. Do you wan the same instance of the button which keeps moving around to a different parent depending upon whatever page is active or do you simply want another instance of the button. You can also see if you can put the button on the parent sheet itself. ---------- Ajay Kalra ajaykalra@yahoo.com I would just put a button on both pages and sync th...