Message 1 of 19
Does VBA support interface inheritance?

Not applicable
04-05-2007
10:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
kind of thinking out loud here.
I was wondering if one can use an interface to create polymorphic forms?
sample scenario:
various programs require a form to allow user to select some acad
collection item
ProgA wants a form SelectBlock
ProgB wants a form SelectLayer
ProgC wants a form SelectDimStyle
etc
so all those forms could theoretically derive from Ifrm_SelectCollectionItem
Ifrm_SelectCollectionItem has a ListBox and two command buttons
cmdSelectItem and cmdClose
I vaguely understand the idea of interfaces
a (virtual) class with method signatures only (empty), implemented by some
(concrete) class which implements the interface
As a form is also a class, i was wondering if the same can apply to forms
Not sure how that would have to be coded
Not sure if theres an advantage compared to just 3 simple forms, one for
each collection type,
or rather one form with a property for which collection to look at,
dim f as frmSelectCollectionItem
Set f = New frmSelectCollectionItem
f.CollectionType = "Blocks"
f.Title = "Select Block"
f.Show
but thought I'd ask to see what the experts might say
Thanks for any ideas
Mark
kind of thinking out loud here.
I was wondering if one can use an interface to create polymorphic forms?
sample scenario:
various programs require a form to allow user to select some acad
collection item
ProgA wants a form SelectBlock
ProgB wants a form SelectLayer
ProgC wants a form SelectDimStyle
etc
so all those forms could theoretically derive from Ifrm_SelectCollectionItem
Ifrm_SelectCollectionItem has a ListBox and two command buttons
cmdSelectItem and cmdClose
I vaguely understand the idea of interfaces
a (virtual) class with method signatures only (empty), implemented by some
(concrete) class which implements the interface
As a form is also a class, i was wondering if the same can apply to forms
Not sure how that would have to be coded
Not sure if theres an advantage compared to just 3 simple forms, one for
each collection type,
or rather one form with a property for which collection to look at,
dim f as frmSelectCollectionItem
Set f = New frmSelectCollectionItem
f.CollectionType = "Blocks"
f.Title = "Select Block"
f.Show
but thought I'd ask to see what the experts might say
Thanks for any ideas
Mark