Attributed Title in Checkbox via MBS disables Action Event

Weird thing: I have a checkbox in a Desktop project that rests on a green background (a rectangle). To increase the text readability, I have this code in the open event of the control:

#If TargetMacOS Dim v As New NSButtonMBS (Me.Handle) Dim attTitle As New NSMutableAttributedStringMBS Dim result As Boolean = attTitle.initWithString(Me.Caption) attTitle.addAttribute(NSMutableAttributedStringMBS.NSForegroundColorAttributeName, NSColorMBS.whiteColor, New NSRangeMBS(0, Me.Caption.ToText.Length)) v.attributedTitle = attTitle #EndIf

Which works: The text is white now.
Only problem: Once this code was run, the control‘s Action event does not fire anymore.
Any ideas how to solve this?

Yes, the plugin connects the Action event of the plugin class.

Please use this code:

#If TargetMacOS Dim v As NSButtonMBS = me.NSButtonMBS Dim attTitle As New NSMutableAttributedStringMBS Dim result As Boolean = attTitle.initWithString(Me.Caption) attTitle.addAttribute(NSMutableAttributedStringMBS.NSForegroundColorAttributeName, NSColorMBS.whiteColor, New NSRangeMBS(0, Me.Caption.ToText.Length)) v.attributedTitle = attTitle #EndIf

Which does not connect them.

Perfect! Thanks a lot!