Page 1 of 1

DateTime Format in .NET

Posted: Sun Jul 04, 2004 7:45 am
by 9336040
Please advise me how to format bottom axis datetime data of TChartAx6 in VB.NET
for example
Dim P as integer
p = AxTChart1.Series(0).YValues.Locate(AxTChart1.Series(0).YValues.Minimum)

<--Both followings 2 line does not work-->

TextBox1.Text = Format(AxTChart1.Series(0).XValues.Value(p), "yy/mm/dd hh:mm")

TextBox1.Text = AxTChart1.Series(0).XValues.Value(p).ToString("yy/mm/dd hh:mm")

Thanks in advance.

Posted: Mon Jul 05, 2004 9:42 am
by Pep
Hi,

you can do this :

Code: Select all

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        TextBox1.Text = DateTime.FromOADate(AxTChart1.Series(0).XValues.Value(1)).ToString()
    End Sub