Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Custom label
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Custom label

 Post Reply Post Reply
Author
Message
Woody View Drop Down
Newbie
Newbie


Joined: 07 July 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Woody Quote  Post ReplyReply Direct Link To This Post Topic: Custom label
    Posted: 04 August 2004 at 7:57am
I can't find anything on using the xtpControlCustom feature.
How can I add a custom label to a toolbar on an MDI form?
Thanks
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2004 at 8:03am
To add a form that contains some controls, you can do something like this:

    Set ControlEdit = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Edit", -1, False)
    ControlEdit.Id = ID_EDIT
    With ControlEdit.CommandBar.Controls
        
        Dim ControlSearch As CommandBarControlCustom
        Dim crtlSearchForm As New frmSearch
       
        Set Control = .Add(xtpControlPopup, 0, "&Search", -1, False)
        Control.Id = ID_EDIT_FIND
        Set ControlSearch = Control.CommandBar.Controls.Add(xtpControlCustom, ID_SEARCH_FORM, "Search Form", -1, False)
        ControlSearch.Handle = crtlSearchForm.hwnd
       
        Set Control = .Add(xtpControlButton, ID_EDIT_CUT, "Cu&t", -1, False)
        Control.BeginGroup = True
        .Add xtpControlButton, ID_EDIT_COPY, "&Copy", -1, False
        .Add xtpControlButton, ID_EDIT_PASTE, "&Paste", -1, False
    End With

Basically, you can add anything that has a hwnd.  If the control does not have a hwnd, then you will have to place it on a form or inside another control that does have a hwnd.
Back to Top
Woody View Drop Down
Newbie
Newbie


Joined: 07 July 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Woody Quote  Post ReplyReply Direct Link To This Post Posted: 06 August 2004 at 3:56pm
Thanks, it works fine now!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.