0

Hi All,

Can I put text in datetimepicker.

Instead of it showed the dafault date and time (today's date), can I put text like e.g
- Please Select Date -


Looking forward to hear from u guys soon...


URGENT

4
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by codeorder
0

No.

Don't forget to mark threads as solved that have answered your question.

Edited by Unhnd_Exception: n/a

1

Hi,

Add a label in designtime and place it above the datetimepicker, just like Codeorder showed.

In the properties of the label set the text: - Please Select Date - and the textalign = center.

That's all.

Votes + Comments
thanks
0

Also, set the Label's AutoSize = False in the Label's Properties.
This will let you resize the Label.

If you need code, see if this helps.
1 DateTimePicker, 1 Label

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        With Label1
            .BackColor = Color.White  '// keep color of DateTimePicker.
            .AutoSize = False '// allow's resizing of Label.
            .Size = New Size(DateTimePicker1.Width - 80, 16) '// sized to fit the DateTimePicker's window.
            .Text = "- Please Select Date - " '// your text.
            .TextAlign = ContentAlignment.MiddleCenter '// align text.
            .Location = New Point(DateTimePicker1.Location.X + 5, DateTimePicker1.Location.Y + 2) '// place Label in proper location.
            .BringToFront() '// bring to front if needed.
        End With
    End Sub
End Class
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.