Beispiel #1
0
 /// <summary>
 /// Creates a ControlFinder that will find controls on a specific Form according to their name.
 /// </summary>
 /// <param name="name">The name of the Control to find.</param>
 /// <param name="form">The form to search for the control.</param>
 public ControlFinder(string name, Form form)
 {
     this.name = name;
     if (form != null)
     {
         forms = new FormCollection();
         forms.Add(form);
     }
 }
Beispiel #2
0
		/// <summary>
		/// Creates a ComponentFinder that will find Components on a specific Form according to their name.
		/// </summary>
		/// <param name="name">The name of the Component to find.</param>
		/// <param name="form">The form to search for the Component.</param>
		public ComponentFinder(string name, Form form)
		{
			this.name = name;
			if(form != null)
			{
				forms = new FormCollection();
				forms.Add(form);
			}
		}
Beispiel #3
0
 /// <summary>
 /// Constructor used to search for a ToolStripItem in a given form. If the form
 /// is null we seach in all forms in the current application.
 /// </summary>
 /// <param name="name"></param>
 /// <param name="form"></param>
 public ToolStripItemFinder(string name, Form form)
 {
     this.name = name;
     if (form != null)
     {
         forms = new FormCollection();
         forms.Add(form);
     }
 }
Beispiel #4
0
        private int OnEnumWindow(IntPtr hwnd, IntPtr lParam)
        {
            Control control = Form.FromHandle(hwnd);

            if (control != null)
            {
                Form form = control as Form;
                if (form != null)
                {
                    if (name == null || form.Name == name)
                    {
                        forms.Add(form);
                    }
                }
            }
            return(1);
        }