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

CreateCommandBarControl And Click

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


Joined: 16 September 2010
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote MottoDoki Quote  Post ReplyReply Direct Link To This Post Topic: CreateCommandBarControl And Click
    Posted: 27 October 2010 at 9:52am

Hello everyone,

I'm trying to use a ControlMarkupLabel on my CommandBar and doing like RibbonSample App Sample (but no ribbon style Embarrassed  ):
Dim ToolBarMenuFile As CommandBar
Dim ControlWS As CommandBarControl
Set ToolBarMenuFile = CommandBars.Add("TBMenu_File", xtpBarTop)
With ToolBarMenuFile
            Set ControlWS = CommandBars.CreateCommandBarControl("CXTPControlMarkupLabel")
            ControlWS.Id = ID_CMDBAR_MDIMAIN_WS
            ControlWS.Caption = "<TextBlock TextAlignment='Center'><Image Margin='0, 0, 0, 0' Cursor='Hand' Source='file://mypicture.ico'/></TextBlock>"
            ControlWS.BeginGroup = True
            ControlWS.Enabled = True
            .Controls.AddControl ControlWS
End With

In that case CommandBars_Execute event never fire.

So i tried something else like that, using external  MarkupLabel and custom control:
Dim ToolBarMenuFile As CommandBar
Dim ControlWS As CommandBarControl
Set ToolBarMenuFile = CommandBars.Add("TBMenu_File", xtpBarTop)
With ToolBarMenuFile
                       mklWS.Caption = "<TextBlock TextAlignment='Center'><Image Margin='0, 0, 0, 0' Cursor='Hand' Source='file://mypicture.ico'/></TextBlock>"
            Set ControlWS = CommandBars.CreateCommandBarControl("CXTPControlCustom")
            ControlWS.Style = xtpButtonIcon
            ControlWS.BeginGroup = True
            ControlWS.Id = ID_CMDBAR_MDIMAIN_WS
            ControlWS.Flags = xtpFlagControlStretched
            ControlWS.Handle = mklWS.hWnd
            .Controls.AddControl ControlWS
EndWith

In this case CommandBars_Execute event fire after 2 click and the first click make the icon to disappear Dead

So if anyone have any idea i will really appreciate thank you

Using CJ 13.4.1 Under XP sp3 And VB6 sp6 Icon Size are 32*32



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.157 seconds.