CreateCommandBarControl And Click |
Post Reply |
Author | |
MottoDoki
Newbie Joined: 16 September 2010 Status: Offline Points: 5 |
Post Options
Thanks(0)
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 ): 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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |