lanterntypes is an enum, of which the first is ParCan, and I have a rich text box called txtbxParCan so I don't think there is a problem with the names in fact being different.

I've used this method before in this same project succesfully with labels, so any help as to what I'm doing wrong now would be gratefully received.

Cheers to anyone who can help!

Tam

March 2nd, 2011, 12:16 AM

BigEd781

Re: [Q] Issue with (RichTextBox)this.Controls[...];

Oh, yeesh. There is rarely a good reason to access controls by their name. Make your life easier and keep a reference to the controls. If they're added in the designer you already have that. If you are creating these at runtime then add them to a collection of RickTextBox controls.