6 Replies - 12199 Views - Last Post: 28 February 2012 - 06:44 PM Rate Topic: -----

#1 Jerrrum  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-February 12

Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 03:30 PM

Hello, i am trying to use a date time picker in an input box to search for records in a database via the date. However i do not know how to get a date time picker into an input box. Any help would be appreciated! Thanks!
Is This A Good Question/Topic? 0
  • +

Replies To: Vb.net How to use a date-time picker in an inputbox

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9090
  • View blog
  • Posts: 34,142
  • Joined: 12-June 08

Re: Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 03:35 PM

You make your own form with said control in it.. don't rely on .NET's default "inputbox".
Was This Post Helpful? 0
  • +
  • -

#3 m_wylie85  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 96
  • View blog
  • Posts: 899
  • Joined: 15-October 10

Re: Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 03:36 PM

I am not sure i understand what you mean. You want the date time picker into a input box? why not just use the date time picker control in tools then take the value that the user selects in the date time picker control and search the database from that value
Was This Post Helpful? 0
  • +
  • -

#4 kingsonprisonic  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 74
  • Joined: 09-July 09

Re: Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 05:05 PM

You can't directly add a DateTimePicker into input box. But you can make one like the input box.

Just add a form name it as FrmInput

now add a DateTimePicker to that form and on ValueChange event or similar event you use code like

Form1.Textbox1.Text=Me.DateTimePicker1.Value.ToString()



So it's like a input box with DateTimePicker..

If i am not clear please let me know...
Was This Post Helpful? 0
  • +
  • -

#5 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2256
  • View blog
  • Posts: 9,444
  • Joined: 29-May 08

Re: Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 05:20 PM

Have a look at Custom Inputbox Tutorial for some Ideas what to do.
Was This Post Helpful? 2
  • +
  • -

#6 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 583
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 06:01 PM

Here's some steps.
  • Get a brand new form
  • Add a DateTimePicker to it
  • Add a button labelled "OK"
  • In the button click event, put: Me.DialogResult = System.Windows.Forms.DialogResult.OK
  • Call this from the main form: If <other form>.DialogResult = Windows.Forms.DialogResult.OK Then
    'do stuff here

And that should help.
Was This Post Helpful? 0
  • +
  • -

#7 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: Vb.net How to use a date-time picker in an inputbox

Posted 28 February 2012 - 06:44 PM

View Postkingsonprisonic, on 28 February 2012 - 07:05 PM, said:

You can't directly add a DateTimePicker into input box. But you can make one like the input box.

Just add a form name it as FrmInput

now add a DateTimePicker to that form and on ValueChange event or similar event you use code like

Form1.Textbox1.Text=Me.DateTimePicker1.Value.ToString()



So it's like a input box with DateTimePicker..

If i am not clear please let me know...


Why name it FrmInput and then call Form1? :D

Sorry, couldn't resist. The alcohol is kicking in.

This post has been edited by CharlieMay: 28 February 2012 - 06:45 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1