Ejemplo n.º 1
0
        public ControlTester <TCtl> FindControl <TCtl>(string UniqueName, bool IgnoreCase) where TCtl : System.Windows.Forms.Control
        {
            System.Windows.Forms.Control ctl = this.FindControl <TCtl>(this.Control, UniqueName, IgnoreCase);
            ControlTester <TCtl>         ret = null;

            if (ctl != null)
            {
                ret = new ControlTester <TCtl>((TCtl)ctl);
            }
            return(ret);
        }
Ejemplo n.º 2
0
        public ControlTester <TCtl> Get <TCtl>(string Name, bool IgnoreCase) where TCtl : System.Windows.Forms.Control
        {
            ControlTester <TCtl> ret = null;
            TCtl ctl = null;

            // Find the control under this control.
            foreach (System.Windows.Forms.Control c in this.Control.Controls)
            {
                if (string.Compare(c.Name, Name, IgnoreCase) == 0 && c is TCtl)
                {
                    ctl = (TCtl)c;
                    break;
                }
            }
            // Create the instance of the control and return.
            if (ctl != null)
            {
                ret = new ControlTester <TCtl>(ctl);
            }
            return(ret);
        }