Since the designer generates the components
variable as private, reflection is the only way to go. Of course you can be clever and be sure that reflection will be used only once to fetch the instance that you will thereafter point to with a variable of yours, so that subsequent access will be more efficient.
You could make your own designer code serializer, but I think it's a bit of an overkill. Plus, that won't make existing forms components variable more available (unless you reopen the designer for each of them).
If I may: since every forms only have one toolbar (or so it seems?), why don't you browse the form's collection of controls recursively until you find an instance of it?
EDIT:
Since you're using DexExpress then your form will have DevExpress.XtraBars.BarDockControl
instances placed as controls in the form. They are acting as the containers of your component toolbar objects. Look for those at runtime in Form.Controls
. They have a Manager
property that will give you the bar manager they're attached to. Of course from there you'll have access to every toolbars it contains.