Label not changing

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2005
Posts: 175
Reputation: kahaj is an unknown quantity at this point 
Solved Threads: 0
kahaj kahaj is offline Offline
Junior Poster

Label not changing

 
0
  #1
Apr 9th, 2008
I have this program that I thought was complete. Apparently not. The info in lasVegasTimeLabel.Text isn't changing when the info in dropOffDateTimePicker is manipulated.

  1. Public Class shippingForm
  2.  
  3. Private Sub clockTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clockTimer.Tick
  4. 'print current time
  5. currentTimeLabel.Text = String.Format("{0:hh:mm:ss tt}", Date.Now)
  6. End Sub
  7.  
  8. Private Sub shippingForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  9. Dim currentTime As Date = Date.Now 'store current time
  10.  
  11. 'set range of poss drop-off times
  12. dropOffDateTimePicker.MinDate = New Date(currentTime.Year, currentTime.Month, _
  13. currentTime.Day, 0, 0, 0)
  14.  
  15. dropOffDateTimePicker.MaxDate = dropOffDateTimePicker.MinDate.AddDays(1)
  16.  
  17. 'display the delivery time
  18. DisplayDeliveryTime()
  19. End Sub
  20.  
  21. Private Sub dropOffDateTimePicker_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dropOffDateTimePicker.ValueChanged
  22. 'display deliv time
  23. DisplayDeliveryTime()
  24. End Sub
  25.  
  26. 'calculates and displays deliv time
  27. Sub DisplayDeliveryTime()
  28. 'print init deliv time
  29. Dim delivery As Date = DepartureTime()
  30.  
  31. 'add 3 hours to departure and display
  32. delivery = delivery.AddHours(3)
  33. lasVegasTimeLabel.Text = delivery.ToLongDateString & " at " & delivery.ToShortDateString
  34. End Sub
  35.  
  36. 'return flight departure time for slected dorp-off time
  37. Function DepartureTime() As Date
  38.  
  39. Dim currentDate As Date = Date.Now 'store cur date
  40. Dim departTime As Date 'store depart time
  41.  
  42. 'determine which flight teh shipment takes
  43. Select Case dropOffDateTimePicker.Value.Hour
  44. 'seafood will be on noon flight
  45. Case 0 To 10
  46. departTime = New Date(currentDate.Year, currentDate.Month, currentDate.Day, _
  47. 12, 0, 0)
  48. 'seafood will be on tomorrow's noon flight
  49. Case 23
  50. currentDate = currentDate.AddDays(1)
  51. departTime = New Date(currentDate.Year, currentDate.Month, currentDate.Day, _
  52. 12, 0, 0)
  53. 'seafood will be on midnight flight
  54. Case Else
  55. currentDate = currentDate.AddDays(1)
  56. departTime = New Date(currentDate.Year, currentDate.Month, currentDate.Day, _
  57. 0, 0, 0)
  58. End Select
  59. Return DepartureTime
  60. End Function
  61. End Class ' ShippingTimeForm

What am I missing here?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC