Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a DateTimePicker to a ToolStrip's Item Collection
Message
De
17/11/2009 08:39:42
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Adding a DateTimePicker to a ToolStrip's Item Collection
Divers
Thread ID:
01435170
Message ID:
01435170
Vues:
743
Hello Universal Thread,

After years of putting it off I have finally thrown myself, feet first, into .Net using Visual Basic 2008. With the aid of Kevin McNeish's ".Net for Visual FoxPro developers" and a Sams Teach Yourself in 24 Hours book I've made great headway in the last 48 hours.

I've kind of struck a brick wall though, despite a morning's googling.

I've successfully added a DateTimePicker control to one of my main form's ToolStrip controls, albeit programatically, using the ToolStripControlHost. I've even come close to having the DateTimePicker visible at design time, by creating a class that inherits the ToolStripControlHost. The control was visible within the toolstrip but eventually started to generate the same error that prevented me using the MSDN sample code for using ToolStripControlHost. (Constructor on type 'System.Windows.Forms.ToolStripControlHost' not found. )

Now I can continue to add my custom ToolStripItems programmatically but what I would really like to do is have my custom controls available at design time, within the ToolStrip's item collection. That way I can have my own custom items available on any ToolStrip at the click of a button.

I've read through sample code that appears to do this for a custom toolstrip (http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=7233&lngWId=10) but cannot see how the control has been made available.

Can anyone help shed some light on this? Is it possible to achieve? If so, can anyone give me any tips or advice as to how a novice VB 2008 user (VFP user at heart) should go about it?

Many thanks in advance for any help or advice anyone can offer.
Ben Sugden

"Remember to enjoy hunting - and that means relishing the search for the product that has never been advertised or placed handily at the front of the shop; Life begins on the uppermost shelf, avoid guide books and top 10's like the plague." - Ramsey Dukes
Répondre
Fil
Voir

Click here to load this message in the networking platform