Could you please consider to provide a 'tab click' event?
Closed this issue · 7 comments
There's no event on ribbon tab.
Thanks for your great work.
You are right. There should be an ExecuteEvent for tab and some more controls.
I will try to fix it.
I have debugged the ExecuteEvent for Ribbon tabs. From UIRibbon there is no ExecuteEvent fireing for the tab.
listening-for-ribbon-events speek about additional events for the UIRibbon. But the documentation is a bit of poor for Implementation. The Interfaces are implemented in the RibbonLib. You can try to work with these interfaces if you really need an event for the ribbon tab.
If it works then you can drop a Pull request.
I was able to do it but there is a little thing to pay attention.
I use VB.NET.
The trick is using the EventLogger in this way:
AddHandler Ribbon1.EventLogger.LogEvent, Sub(sender As Object, args As EventLoggerEventArgs)
If args.EventType = Interop.EventType.TabActivated Then
Select Case args.CommandName
Case "tabDocuments"
multiPaginaPrincipale.SelectedIndex = 1
Case Else
multiPaginaPrincipale.SelectedIndex = 0
End Select
End If
End Sub
But when building to x64 as I always do, the memory layout of the EventParameters struct was corrupted because in 64 bit environment the FieldOffset in this particular case is 8 and not 4, so the entire EventParametersCommand field is shifted of 4 bytes and the CLR was returning an access violation error because the pointers of the command names strings were invalid.
I suggest to handle this particular situation. I have downloaded the code and created a custom build, I support only x64 systems.
@montagnamarco
Thanks for detailed analysis.
I have done some changes in the EventParameters struct which should work in x86 and x64.
Could you please download the latest code and create a custom build?
Hi! It seems to work fine now :-) Thank you!
The previous comment was written by me, from a different GH account.
Solved in Pre-Release v2.15.2