Unless I'm missing something, you are always setting
inspStartTime.StartTime and inspEndTime.EndTime to btn.Text.  They
will always be the same, because there's no possible path where you
set them to different values.

I'm guessing there's something you're not including, because this is
just too obvious to miss - if there's any other code that's missing
here, then you may want to look there.

On Apr 24, 2:56 pm, Emmanuel <[email protected]> wrote:
> On my error message both inspStartTime.StartTime & inspEndTime.EndTime
> end up being the same values returned.  Although they each belogn to a
> different textbox. Any clues?
>
> [CODE]
>            for (int i = 0; i < VisualTreeHelper.GetChildrenCount
> (myVisual); i++)
>             {
>                 // Retrieve child visual at specified index value.
>                 Visual childVisual = (Visual)VisualTreeHelper.GetChild
> (myVisual, i);
>
>                 // Do processing of the child visual object.
>                 if (childVisual is TextBox)
>                 {
>                     MaskedTextBox btn = (MaskedTextBox)childVisual;
>                     //Check first to see if the element is null
>                     if (btn.Tag != null)
>                     {
>
>                         inspStartTime = new InspectionTime();
>                         inspStartTime.TimeID = Convert.ToInt32
> (btn.Uid);
>                         inspStartTime.StartTime = btn.Text;
>
>                         inspEndTime = new InspectionTime();
>                         inspEndTime.TimeID = Convert.ToInt32(btn.Uid);
>                         inspEndTime.EndTime = btn.Text;
>
>                        // updateMileage = Convert.ToInt32
> (StartTime.Text.Trim());
>                        // updateMileage = Convert.ToInt32
> (EndTime.Text.Trim());
>
>                         {
>          control.ShowErrorMessage("Litte Test." +
> inspStartTime.StartTime + " " + inspEndTime.EndTime,
> MessageBoxImage.Exclamation);
>                         }
> [/CODE]

Reply via email to