AODL.Document.Forms.ODFForm.FindControlByName C# (CSharp) Method

FindControlByName() public method

Looks up a control by its name
public FindControlByName ( string name, bool searchInSubforms ) : ODFFormControl
name string
searchInSubforms bool Specifies whether to look in the subforms
return AODL.Document.Forms.Controls.ODFFormControl
		public ODFFormControl FindControlByName (string name, bool searchInSubforms)
		{
			if (searchInSubforms)
			{
				foreach (ODFForm f in ChildForms)
				{
					ODFFormControl ctrl;
					ctrl = f.FindControlByName(name, true);
					if (ctrl != null) return ctrl;
				}
			}
			foreach (ODFFormControl c in _controls)
			{
				if ( c != null)
				{
					if (c.Name == name)
						return c;
				}
			}
			return null;
		}