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!
6 Replies - 3395 Views - Last Post: 28 February 2012 - 06:44 PM
#1
Vb.net How to use a date-time picker in an inputbox
Posted 28 February 2012 - 03:30 PM
Replies To: Vb.net How to use a date-time picker in an inputbox
#2
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".
#3
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
#4
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
So it's like a input box with DateTimePicker..
If i am not clear please let me know...
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...
#5
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.
#6
Re: Vb.net How to use a date-time picker in an inputbox
Posted 28 February 2012 - 06:01 PM
Here's some steps.
And that should help.
- 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.
#7
Re: Vb.net How to use a date-time picker in an inputbox
Posted 28 February 2012 - 06:44 PM
kingsonprisonic, 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
So it's like a input box with DateTimePicker..
If i am not clear please let me know...
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?
Sorry, couldn't resist. The alcohol is kicking in.
This post has been edited by CharlieMay: 28 February 2012 - 06:45 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote










|