How to add DateTimePicker to ToolStrip?

isawa

Active member
Joined
Oct 3, 2005
Messages
25
Programming Experience
Beginner
How to add DateTimePicker to ToolStrip control show me some code?

Thanks,:eek:
 
VB.NET:
[SIZE=2]ToolStrip1.Items.Add([/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] ToolStripControlHost([/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] DateTimePicker))
[/SIZE]
 
to catch events etc you perhaps want to this:
VB.NET:
WithEvents dtp As New DateTimePicker
 
Private Sub Form1_Load(sender, e) Handles MyBase.Load
  ToolStrip1.Items.Add(New ToolStripControlHost(dtp))
End Sub
 
Private Sub dtp_ValueChanged(sender, e) Handles dtp.ValueChanged
  Me.Text = dtp.Value.ToString
End Sub
 
I can get your last sample to work. Is there somthings missing in the catch, a refference. I'm beginner in VB2005 but good om VB6
 
What is the error message?
Did you add the ToolStrip (defaults name ToolStrip1) to the form?
 
How to add DateTimePicker

Thanks for your quick responce.
Now i did not. I found that it was a problem.
My Calender from ComponentGo works really super with your tip about DateTimePicker and Tooltips.
 
Back
Top