Yes, each control has a property called Container that returns the container
(e.g. form, another control...) of that control. You can traverse up the
list of Containers (i.e. find the container of your button, then find the
container of that container and so on until you get null) until you find the
parent of all the controls which should be a form in a simple windows forms
app.
"rua17" <ru***@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I'm creating a special button control that creates a log in the database
every time is touched.
I need to log whe name of the button and the name of the form that
contains it
In some cases the button could be contained by the form, in some cases it
could be contained by a pageframe that is contained by the form...
How can I reference the form name for this case??? is there any property
that has the container of the button?
thanks