Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Child controls in panel event handling
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 5.0
OS:
Windows 7
Network:
SAMBA Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01621652
Message ID:
01621655
Vues:
47
>Hi all, I have a form with a TableLayoutPanel occupying one half of the form, the panel contains lots of custom usercontrols, within the user controls I hook up some events which change the appearance of the control when it is selected or loses focus ( I change their back colour to red when they have focus and reset it to default when they don't) all works as expected while the panel / user control has focus, however if I click on a control outside of the panel the events still fire - which is not what I want as I want the user to know which control in the panel has focus ( the user controls are datagrids containg sets of interest rates ) I hope this makes sense ! so my question is , how can I restrict the events so they only fire when the panel has focus ?

Haven't worked with WinForms for some time but I think that when a user control loses focus you could check whether focus is still on a control in the containing panel (Control.ContainsFocus property). If true then reset to default, if not then leave the child control red....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform