Hello everyone,
I'm trying to use a ControlMarkupLabel on my CommandBar and doing like RibbonSample App Sample (but no ribbon style ): 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
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
|