| | |
Outputting In Listbox....
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2008
Posts: 23
Reputation:
Solved Threads: 0
how do i output like datetimepicker.text to a listbox...
I tried datetimepicker1.text but it did not work....can someone help me please
my code is like this...
Rpanel.Hide()
Plistbox.Items.Add("Customer Name" & ControlChars.Tab & _
ControlChars.Tab & "Booking Date" & ControlChars.Tab & _
ControlChars.Tab & "Booking Time")
Plistbox.Items.Add(Bcusname.Text & ControlChars.Tab & _
ControlChars.Tab & Bdate.Value & ControlChars.Tab & _
ControlChars.Tab & btime1)
I tried datetimepicker1.text but it did not work....can someone help me please
my code is like this...
Rpanel.Hide()
Plistbox.Items.Add("Customer Name" & ControlChars.Tab & _
ControlChars.Tab & "Booking Date" & ControlChars.Tab & _
ControlChars.Tab & "Booking Time")
Plistbox.Items.Add(Bcusname.Text & ControlChars.Tab & _
ControlChars.Tab & Bdate.Value & ControlChars.Tab & _
ControlChars.Tab & btime1)
To show date in long mode :
To show date in Short mode :
DateTimePicker1.Value.ToLongDateString() Ex : Saturday, September 13, 2008To show date in Short mode :
DateTimePicker1.Value.ToShortDateString() Ex : 9/13/2008 Last edited by Jx_Man; Sep 13th, 2008 at 2:22 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
>> now i only wanna display time...i try changing the format but it displays both time and date together....any idea?
To Show current date with long format :
To Show current date with short format :
Visit this site, there are tutorial about Format() function.
To Show current date with long format :
FormatDateTime(TimeOfDay, DateFormat.LongTime) Result : 10:40:05 PMTo Show current date with short format :
FormatDateTime(Now,DateFormat.ShortTime) Or FormatDateTime(TimeOfDay,DateFormat.ShortTime) Result : 22:40Visit this site, there are tutorial about Format() function.
Last edited by Jx_Man; Sep 14th, 2008 at 12:44 pm.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Sep 2008
Posts: 14
Reputation:
Solved Threads: 0
now i only wanna display time...i try changing the format but it displays both time and date together....any idea?[/QUOTE]
hay,
thats not a problem man i can help u. use the following ,u can obtain separately,
"M/d/yy" 12/19/07
"MM-dd-yy" 12-19-07
hh:mm:ss 11:27:07
hh:mm:ss tt 11:27:07 AM
u can use this inside your format.
eg., TextBox1.Text = Format(Now, "hh:mm:ss")
reply pls.,
hay,
thats not a problem man i can help u. use the following ,u can obtain separately,
"M/d/yy" 12/19/07
"MM-dd-yy" 12-19-07
hh:mm:ss 11:27:07
hh:mm:ss tt 11:27:07 AM
u can use this inside your format.
eg., TextBox1.Text = Format(Now, "hh:mm:ss")
reply pls.,
Using timer to check booking time with system time :
On Timer properties
- Set timer Enable = True
- Set Interval = 1000
On Timer properties
- Set timer Enable = True
- Set Interval = 1000
vb Syntax (Toggle Plain Text)
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim btime As DateTime btime = FormatDateTime("1:00:00 AM", DateFormat.LongTime) If FormatDateTime(TimeOfDay, DateFormat.LongTime) = btime Then MsgBox("Booking Time up") End If End Sub
Last edited by Jx_Man; Sep 16th, 2008 at 1:30 am. Reason: Code Tags and some explaination
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Sep 2008
Posts: 23
Reputation:
Solved Threads: 0
hey thank for your help jx_man....my project is 50% complete....i need help with this problem too...appretiate your help.
here is my code
How do set the timer to start 2 hours b4 the booking time?...lets say the booking is at 7, the button will be yellow at 5 only...i try a few ways its not working.....would really appreciate your help...
here is my code
vbnet Syntax (Toggle Plain Text)
If tableno = 1 Then status = "Booked" Table1.BackColor = Color.Khaki Spanel.Hide() Rpanel1.Show() Dim btimeA As DateTime btimeA = FormatDateTime(btime1.Value, DateFormat.LongTime) If FormatDateTime(TimeOfDay, DateFormat.LongTime) = btimeA.AddMinutes(20) Then MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled") Table1.BackColor = Color.PaleGreen status1 = "Available"
How do set the timer to start 2 hours b4 the booking time?...lets say the booking is at 7, the button will be yellow at 5 only...i try a few ways its not working.....would really appreciate your help...
Last edited by cscgal; Sep 20th, 2008 at 12:23 am. Reason: Added code tags
- using TimeSerial() Function to get 2 hours before booking time.
see this line
- question for u : btime1 is datetimepicker or not?
if yes then set Format = Time on datepicker properties
see this line
bTimeUp = TimeSerial(btimeA.Hour - 2, btimeA.Minute, btimeA.Second) vb.net Syntax (Toggle Plain Text)
Dim bTimeA As DateTime Dim bTimeUp As DateTime btimeA = FormatDateTime(btime1.Value, DateFormat.LongTime) bTimeUp = TimeSerial(btimeA.Hour - 2, btimeA.Minute, btimeA.Second) If FormatDateTime(TimeOfDay, DateFormat.LongTime) = bTimeUp Then MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled") Table1.BackColor = Color.PaleGreen status1 = "Available" End If
- question for u : btime1 is datetimepicker or not?
if yes then set Format = Time on datepicker properties
Last edited by Jx_Man; Sep 20th, 2008 at 2:07 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: save to Database
- Next Thread: Generating unique filenames
Views: 1708 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 2008 access add application array assignment basic box button buttons center class click code combo convert cpu data database datagrid datagridview design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees error excel exists firewall function image images isnumericfuntioncall listview login map math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan picturebox port print printing printpreview problem record refresh regex reports" reuse right-to-left save savedialog search serial socket sorting sql sqldatbase storedprocedure string structures studio temp textbox timer txttoxmlconverter upload useraccounts usercontol usercontrol vb vb.net vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml






