Filling list box with available date formats

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

Join Date: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Filling list box with available date formats

 
0
  #1
Jun 3rd, 2008
Hi all


Im loading list box with availabel datetime formats . but it is loading all the date time formats twice...
here is my code:


Dim dateTime As DateTime = New _
DateTime(Now.Year, Now.Month, Now.Day, Now.Hour, _
Now.Minute, Now.Second)
Dim d() As String = Nothing
d = dateTime.GetDateTimeFormats()
lstdateandtime.Items.AddRange(d)
how to sort out this issue?
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: Filling list box with available date formats

 
0
  #2
Jun 3rd, 2008
i think its not twice but all formats of date-time. short or long formats, country formats..
why don't use datetime picker?
  1. ListBox1.Items.Add(DateTimePicker1.Value.Now)
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: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Re: Filling list box with available date formats

 
0
  #3
Jun 4th, 2008
Thanks for ur reply Jx_man. if i use date time picker it loads only one format of date.
and i want to load the listbox with all available datetime formats..
My code is loading all datetime formats but values are repeating i dont know why
is there any way to sort them?


thanks.
Last edited by Pgmer; Jun 4th, 2008 at 5:23 am.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Re: Filling list box with available date formats

 
0
  #4
Jun 9th, 2008
Originally Posted by Pgmer View Post
Thanks for ur reply Jx_man. if i use date time picker it loads only one format of date.
and i want to load the listbox with all available datetime formats..
My code is loading all datetime formats but values are repeating i dont know why
is there any way to sort them?


thanks.
Any one have idea about this issue?
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: Filling list box with available date formats

 
0
  #5
Jun 9th, 2008
lstdateandtime.Sorted = True
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: Apr 2008
Posts: 54
Reputation: Pgmer is an unknown quantity at this point 
Solved Threads: 5
Pgmer Pgmer is offline Offline
Junior Poster in Training

Re: Filling list box with available date formats

 
0
  #6
Jun 12th, 2008
No if i use sort it just sort it by name or somthing.
it is not going remove the duplicates.
any how i managed to elimanate the duplictes.
Thanks.
Last edited by Pgmer; Jun 12th, 2008 at 3:37 am.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
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