public void CargarAyuda(Control.ControlCollection controlCollection) { IElementoBD c = null; foreach (Control ctrl in controlCollection) { if (ctrl is IElementoBD) { c = (IElementoBD)ctrl; if (!string.IsNullOrEmpty(c.TablaCampoBD)) { _helpProvider.SetHelpString(ctrl, AdministradorAyuda.Instance.ObtenerPorNombreCampo(c.TablaCampoBD)); _helpProvider.SetShowHelp(ctrl, true); _toolTip.SetToolTip(ctrl, AdministradorAyuda.Instance.ObtenerPorNombreCampo(c.TablaCampoBD)); ctrl.Enter += new EventHandler(ctrl_Enter); ctrl.Leave += new EventHandler(ctrl_Leave); ModeloQuantum.AdministradorControles.Instance.DefinirConfiguracionControl(this.Name, ctrl, c.TablaCampoBD); } } if (ctrl is CNDCGridView) { (ctrl as CNDCGridView).AplicarEstilo(); } if (ctrl is IControlCNDC) { IControlCNDC iControl = ctrl as IControlCNDC; if (iControl.EnterComoTab) { ctrl.KeyUp += new KeyEventHandler(ctrl_KeyUp); } } if (ctrl is CNDCLabel) { CNDCLabel lbl = (ctrl as CNDCLabel); CargarFont(lbl.Font); lbl.Font = _fuenteQuantum; } if (ctrl is TabControl) { TabControl tabControl = ctrl as TabControl; foreach (TabPage p in tabControl.TabPages) { CargarAyuda(p.Controls); } } else if (ctrl.Controls.Count > 0) { CargarAyuda(ctrl.Controls); } } }
private void ctrl_Enter(object sender, EventArgs e) { if (sender is IElementoBD) { IElementoBD c = (IElementoBD)sender; string extra = string.Empty; if (sender is TextBox && (sender as TextBox).ReadOnly) { extra = " (Sólo Lectura)"; } SetAyudaEnLinea(AdministradorAyuda.Instance.ObtenerPorNombreCampo(c.TablaCampoBD) + extra); } }