| | |
Label not changing
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Sep 2005
Posts: 175
Reputation:
Solved Threads: 0
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.
What am I missing here?
VB.NET Syntax (Toggle Plain Text)
Public Class shippingForm Private Sub clockTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clockTimer.Tick 'print current time currentTimeLabel.Text = String.Format("{0:hh:mm:ss tt}", Date.Now) End Sub Private Sub shippingForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim currentTime As Date = Date.Now 'store current time 'set range of poss drop-off times dropOffDateTimePicker.MinDate = New Date(currentTime.Year, currentTime.Month, _ currentTime.Day, 0, 0, 0) dropOffDateTimePicker.MaxDate = dropOffDateTimePicker.MinDate.AddDays(1) 'display the delivery time DisplayDeliveryTime() End Sub Private Sub dropOffDateTimePicker_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dropOffDateTimePicker.ValueChanged 'display deliv time DisplayDeliveryTime() End Sub 'calculates and displays deliv time Sub DisplayDeliveryTime() 'print init deliv time Dim delivery As Date = DepartureTime() 'add 3 hours to departure and display delivery = delivery.AddHours(3) lasVegasTimeLabel.Text = delivery.ToLongDateString & " at " & delivery.ToShortDateString End Sub 'return flight departure time for slected dorp-off time Function DepartureTime() As Date Dim currentDate As Date = Date.Now 'store cur date Dim departTime As Date 'store depart time 'determine which flight teh shipment takes Select Case dropOffDateTimePicker.Value.Hour 'seafood will be on noon flight Case 0 To 10 departTime = New Date(currentDate.Year, currentDate.Month, currentDate.Day, _ 12, 0, 0) 'seafood will be on tomorrow's noon flight Case 23 currentDate = currentDate.AddDays(1) departTime = New Date(currentDate.Year, currentDate.Month, currentDate.Day, _ 12, 0, 0) 'seafood will be on midnight flight Case Else currentDate = currentDate.AddDays(1) departTime = New Date(currentDate.Year, currentDate.Month, currentDate.Day, _ 0, 0, 0) End Select Return DepartureTime End Function End Class ' ShippingTimeForm
What am I missing here?
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Visual Basic.net Database application
- Next Thread: Problem with connection to SQL database
| Thread Tools | Search this Thread |
"crystal .net .net2005 .net2008 30minutes 2008 access add application array assignment basic beginner box browser button buttons click code combo connectionstring convert cpu cuesent data database databasesearch datagrid datagridview datetimepicker design designer dissertation dissertations dissertationthesis dissertationtopic dosconsolevb.net editvb.net exists firewall folder forms html image images isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open panel peertopeervideostreaming picturebox2 port print printing printpreview record regex reports" reuse right-to-left savedialog serial settings socket sqldatbase sqlserver storedprocedure string temp textbox timer timespan transparency txttoxmlconverter useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml year





