Print Page | Close Window

Custom label

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1015
Printed Date: 13 May 2024 at 3:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Custom label
Posted By: Woody
Subject: Custom label
Date 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



Replies:
Posted By: SuperMario
Date 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.


Posted By: Woody
Date Posted: 06 August 2004 at 3:56pm
Thanks, it works fine now!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net