Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to subclass a control?
Message
De
14/02/2001 10:44:45
 
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00475497
Message ID:
00475735
Vues:
30
>I doubt you can do it in VB6. You need to create Activex controls and then subclass those activex controls. In VB.NET its Possible but I dont know how to do it. I put the question here 2 weeks ago but no reply. OOP is new to the VB world and it will take som time before everyone get a grip of it. I even placed questions to so called VB gurus but no one has the answer.
>and another thing in VFP you can change say The Font of your Base Class and then all over the apps you can see the change straight away. But in VB you have to recompile the Class and only then you can see the change. Hope Beta 2 of VB .NEt has some proper samples
>
>Regards,
>Fred

First of all, thanks for the quick reply!

Now, here's my problem. I want to create a Menu Bar that'll be installed on all the company's computers. I want the users to be able to add their own shortcuts to the bar and to create their own sub-menus. This is done by creating a "script" document (a little like html) that tells the menu bar how many buttons to display, where to put them, what they do, what's their caption or what image to display, etc. This script is read when the bar is created and that's when the bar's appearance is created.

Since all this is done dynamically at run time, I need to be able to instanciate new buttons and new forms (sub-menus) on the go. I thought I could do it using VB but it doesn't seem that a new class can be a subclass of a control (ActiveX or other) and hence, I can't create an instance of those controls at run-time and add them to forms. Seems like all the creation and displaying of controls can only be done at design time. Am I right or can I create instances of a control and add it to a form at run-time (like in Java, FoxPro and C++ for instance)? If so, what would the code look like?

Thanks a lot again for your time, Stephane.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform