Outputting In Listbox....

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 23
Reputation: gopi17 is an unknown quantity at this point 
Solved Threads: 0
gopi17 gopi17 is offline Offline
Newbie Poster

Outputting In Listbox....

 
0
  #1
Sep 13th, 2008
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)
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Outputting In Listbox....

 
0
  #2
Sep 13th, 2008
To show date in long mode :
DateTimePicker1.Value.ToLongDateString() Ex : Saturday, September 13, 2008

To 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 *
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 14
Reputation: silambharasan is an unknown quantity at this point 
Solved Threads: 0
silambharasan silambharasan is offline Offline
Newbie Poster

Re: Outputting In Listbox....

 
0
  #3
Sep 14th, 2008
hay,
i hope it will be worked.you concatenate now to others that it will display current day,month and time.
eg., ListBox1.Items.Add(Now)
reply please.,
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: gopi17 is an unknown quantity at this point 
Solved Threads: 0
gopi17 gopi17 is offline Offline
Newbie Poster

Re: Outputting In Listbox....

 
0
  #4
Sep 14th, 2008
thanks jx..its working....
and yes silam its working too...but now i have another problem...i can display date and time...

now i only wanna display time...i try changing the format but it displays both time and date together....any idea?
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Outputting In Listbox....

 
0
  #5
Sep 14th, 2008
>> 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 :
FormatDateTime(TimeOfDay, DateFormat.LongTime) Result : 10:40:05 PM

To Show current date with short format :
FormatDateTime(Now,DateFormat.ShortTime) Or
FormatDateTime(TimeOfDay,DateFormat.ShortTime) Result : 22:40

Visit 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 *
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 14
Reputation: silambharasan is an unknown quantity at this point 
Solved Threads: 0
silambharasan silambharasan is offline Offline
Newbie Poster

Re: Outputting In Listbox....

 
0
  #6
Sep 14th, 2008
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.,
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: gopi17 is an unknown quantity at this point 
Solved Threads: 0
gopi17 gopi17 is offline Offline
Newbie Poster

Re: Outputting In Listbox....

 
0
  #7
Sep 16th, 2008
thanks alot for your help jx and silam....

say guys can u help with system time...

i have a booking time

eg.

i set the booking time at 1.00 Am,then once the booking equals to system time a messagebox appears....

can i do sumthin like this:

btime.text = date.now

??
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Outputting In Listbox....

 
0
  #8
Sep 16th, 2008
Using timer to check booking time with system time :
On Timer properties
- Set timer Enable = True
- Set Interval = 1000
  1. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  2. Dim btime As DateTime
  3. btime = FormatDateTime("1:00:00 AM", DateFormat.LongTime)
  4. If FormatDateTime(TimeOfDay, DateFormat.LongTime) = btime Then
  5. MsgBox("Booking Time up")
  6. End If
  7. 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 *
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 23
Reputation: gopi17 is an unknown quantity at this point 
Solved Threads: 0
gopi17 gopi17 is offline Offline
Newbie Poster

Re: Outputting In Listbox....

 
0
  #9
Sep 19th, 2008
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
  1. If tableno = 1 Then
  2. status = "Booked"
  3. Table1.BackColor = Color.Khaki
  4. Spanel.Hide()
  5. Rpanel1.Show()
  6.  
  7. Dim btimeA As DateTime
  8. btimeA = FormatDateTime(btime1.Value, DateFormat.LongTime)
  9. If FormatDateTime(TimeOfDay, DateFormat.LongTime) = btimeA.AddMinutes(20) Then
  10. MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled")
  11. Table1.BackColor = Color.PaleGreen
  12. 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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Outputting In Listbox....

 
0
  #10
Sep 20th, 2008
- using TimeSerial() Function to get 2 hours before booking time.
see this line bTimeUp = TimeSerial(btimeA.Hour - 2, btimeA.Minute, btimeA.Second)
  1. Dim bTimeA As DateTime
  2. Dim bTimeUp As DateTime
  3. btimeA = FormatDateTime(btime1.Value, DateFormat.LongTime)
  4. bTimeUp = TimeSerial(btimeA.Hour - 2, btimeA.Minute, btimeA.Second)
  5. If FormatDateTime(TimeOfDay, DateFormat.LongTime) = bTimeUp Then
  6. MsgBox("Booking Time up Mr/Miss " & Bcusname1.Text & " is late,reservation canceled")
  7. Table1.BackColor = Color.PaleGreen
  8. status1 = "Available"
  9. 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 *
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


Views: 1708 | Replies: 12
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC