1. Obtain the menu of pictureedit
Private devexpress. xtraeditors. Controls. picturemenu getmenu (devexpress. xtraeditors. pictureedit edit)
{
Propertyinfo Pi = typeof (devexpress. xtraeditors. pictureedit). getproperty ("menu", bindingflags. nonpublic | bindingflags. instance );
If (Pi! = NULL)
Return pi. getvalue (edit, null) as devexpress. xtraeditors. Controls. picturemenu;
Return NULL;
}
2. Call the method in the menu
Private void invokemenumethod (devexpress. xtraeditors. Controls. picturemenu menu, string name)
{
Methodinfo MI = typeof (devexpress. xtraeditors. Controls. picturemenu). getmethod (name, bindingflags. nonpublic | bindingflags. instance );
If (Mi! = NULL & menu! = NULL)
Mi. Invoke (menu, new object [] {menu, new eventargs ()});
}
3. Example of calling the clear image method
// The name can be on of the following values: onclickedload; onclickedsave; onclickedcut; onclickedcopy; onclickedpaste; onclickeddelete
Private void btnclear_click (Object sender, eventargs E)
{
Invokemenumethod (getmenu (arcont), "onclickeddelete ");
}