Sathish
Sathish

Reputation: 4487

Assign Event by Event Handler

In my application i am using Krypton Component Factory.

My application i have Ribbon Menu and Some krypton buttons. In krypton buttons i want to assign click event of Ribbon Menu Group Button at run time. The events of Ribbon Menu Group Button Changed Based some condition so i tried like this

Dim eventsField = GetType(Component).GetField("events", BindingFlags.NonPublic Or
BindingFlags.Instance)
Dim eventHandlerList = eventsField.GetValue(KryptonRibbonGroupButton1)
eventsField.SetValue(KryptonButton1, eventHandlerList)

Its not work. The Get Field always return nothing.

Problem: I want add handler of Krypton Button Click event by old ribbon menu button throw coding using the controls name only. Its Possible or not? Its possible how to do it?

am using Vb.Net

Upvotes: 0

Views: 210

Answers (1)

Visual Vincent
Visual Vincent

Reputation: 18320

Perhaps you're looking for AddHandler?

Upvotes: 0

Related Questions