• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 984
  • Last Modified:

How to set Datetimepicker in vb.net windows form as default to -Select Date-

I want to set the datetimepicker in vb.net windows form to its default value as --select date--
Because otherwise what default value can be put
  • 2
3 Solutions
Anuradha GoliSystems Development / Support SpecialistCommented:
Use javascript to set watermark text for text box
function watermark(inputId,text)
        var inputBox = document.getElementById(inputId);
        if (inputBox.value.length > 0)
            if (inputBox.value == text)
            inputBox.value = '';
            inputBox.value = text;

Open in new window

<input type="text" name="startdate" class="tcal" id="startdate" readonly="readonly"
                                onfocus="watermark('startdate','select startdate');" onblur="watermark('startdate','select startdate');" />

so that text disappears when mouse hovered

yo can use calendar code attached
Éric MoreauSenior .Net ConsultantCommented:
not sure if you can write something because it isn't a valid value. one thing for sure, you can leave it empty. check http://emoreau.com/Entries/Articles/2005/01/The-DateTimePicker-control.aspx
searchsanjaysharmaAuthor Commented:
kindly give inputs for windows form in vb.net datetimepicker
searchsanjaysharmaAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now