Install an Event Handler to the object.
BOOL SetEventHandler( LPCSTR lpcszClassName )
// The following code installs an Event Handler class called InsertRelatedCols into every odd column in the worksheet
// OneColheaderHandler is a class implemented in OriginEvents.c. It is derived from a base class called OneColheaderHandler
// You can create your own class and install it into columns that require customized event handling. Make sure your class is
// based on OneColheaderHandler for column events handling.
Worksheet wks = Project.ActiveLayer();
int ii = 1;
foreach(Column cc in wks.Columns)
string str = "InsertRelatedCols";
Install an Event Handler to the object. Event handlers are Origin C classes that are derived from ObjectCmdTarget class.
In principle, all class objects that are derived from OriginObejct are capable of handling Event Handlers, but not all of them have internal events properly connected to Origin C. Currently, only the followings are supported, more will be added in the future.
GraphObject Worksheet WorksheetPage Column