Name property being modified at runtime ???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey all - thanks in advance for the help.

I am messing around with layout management and have a naming issue I cannot
seem to track down. I am handling the layout event (Layout()) for my controls
and, when checking the Name property for any of the children passed in (via
e.AffectedControl.Controls), the name has been modified from what it was
defined in the designer. For instance, if I defined something to be 'MyPanel'
it would come through in the event as 'myPanel1'. I don't know if this is a
known modification and by design but I need to understand this for accurate
control matching. Any help is appreciated.
 
More Info:

It looks like the initial Layout() events come *before* the code that the
designer creates which change the name property. So, the problem isn't that
the name is changed on the fly, the problem is "simply" a sequence issue of
instantiation.

Now to resolve. Other than forcing an additional call to PerformLayout() on
all my controls after the name field is set, is there an alternative (and
more reliable) to using the Name attribute to compare to stored information
(XML or DB - or XAML for that matter) that will uniquely identify (unique
when coupled with the parent heirarchy) the controls so layout can take place?
 
Back
Top