Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to get 2 separate values in alert 1

Status
Not open for further replies.

neoxaml

Programmer
Apr 24, 2009
5
US
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);
                        }
 
inspStartTime.StartTime & inspEndTime.EndTime end up being the same values"

Yes, because you are setting them to the same value:

inspStartTime.StartTime = btn.Text;
inspEndTime.EndTime = btn.Text;


Paul
VBA, C#, Delphi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top