I'd expect dwo.type to return a string corresponding to the type of control clicked (e.g. "bitmap" or "column").
What is the error you're getting in the original snippet? Are you sure it's not just a problem that the dwo is null? There's an old technique (that I'd say is obsolete and a bad programming practice, especially now given the changes in PB) that would fire off system events without supplying parameters (e.g. cb_ok.TriggerEvent (Clicked!)), which would mean your Clicked event executes without a dwo parameter being supplied. This would cause an error on the line you mentioned. Maybe you have some legacy code causing you problems.
Good luck,
Terry.