Why the comboBox is showing actual dates, but

blueeyes53

Active member
Joined
May 2, 2006
Messages
25
Programming Experience
Beginner
Hi there,

I've a form1 with a combobox and 2 listboxes.
The combobox is showing the actual dates, but the list boxes are showing; 0001-01-01

Even before I click on the combobox the 0001-01-01 is showing on the listbox.

How could I correct this issue.

Thanks:)
 
ComboBox is not populating the 2 listBox

VB.NET:
Dim DateandTime As Date
Dim Temperatures As Single
Dim pstr As DateTime
Dim pintTotal As Integer



VB.NET:
Private DateTime() As SelectDateandTime
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim psrdCurrent As System.IO.StreamReader
Dim pintCount As Integer
Dim pstrLine As String
Dim pstrFields() As String
Dim pchrDelimiter As Char() = {ToChar(",")}
Dim pstr As DateTime
ofdDateTime.ShowDialog()
psrdCurrent = New System.IO.StreamReader(ofdDateTime.FileName)
pstrLine = psrdCurrent.ReadLine()
Do Until pstrLine = Nothing
ReDim Preserve DateTime(pintCount)
pstrFields = pstrLine.Split(pchrDelimiter)
DateTime(pintCount).DateandTime = pstrFields(0)
DateTime(pintCount).Temperatures = pstrFields(1)
pintCount += 1
pstrLine = psrdCurrent.ReadLine()
Loop
psrdCurrent.Close()
For pintCount = 0 To DateTime.GetUpperBound(0)
If cboSelectDate.Items.Add(DateTime(pintCount).DateandTime) Then
 
lstDateTime.Items.Add(pstr.ToShortDateString)
lstTemperatures.Items.Add(pstr.ToString)
 
 
 
 
 
 
 
 
 
End If
 
 
 
Next
lblAverageSize.Text = lstTemperatures.Items.Count.ToString
For pintCount = 0 To lstTemperatures.Items.Count - 1
Next
lblAverageSize.Text = (pintTotal.GetType.ToString)

Thanks
 
sorry friend this is very confusing code and not well commented too (actually documentation is missing ..) so i am not sure what you are doing here. Maybe if you explain your idea i can find a different approach. Or maybe someone else from the forum will understand your code and provide solution.
Regards ;)
 
Back
Top