Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / November 2003



Tip: Looking for answers? Try searching our database.

ActiveX Control in VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arunan - 24 Nov 2003 07:44 GMT
I am creating a ActiveX Control in VB. But I cann't create
groups like Toolbar's Buttons or StatusBar's Panel.

Eg:
    Toolbar1.Buttons.Item
    StatusBar1.Panels.Item
    TabStrip1.Tabs.Item

How to create group like thease?

Note: I'm useing VB6
Dmitriy Antonov - 24 Nov 2003 17:56 GMT
I think, you need to create two additional classes within your ActiveX
control project: one will work as collection of item and another one -
actual item.

For example, if you want to have syntax like this-MyControl.Buttons.Items,
then you should:
1. Place public property (or function) named Buttons in your Control's
module. This should return object of collection class (most obviously it
should be named as Buttons or ButtonsCol or something like this).
2. Class Buttons should have public property Item (usually it is specified
as default one), which returns object of class Button. Class Buttons should
contain internal collection of objects of class Button (usually implemented
with use of standard VB Collection). You probably want to implement other
traditional "collectional" functionality, like Add, Remove, NewEnum. These
are routings, which are located in the Buttons class.
3.You should have class Button, which has all appropriate props, methods and
events (For example, Caption,Text,Background and so on).

Since I don't know what actually you are going to do I can't tell you how
you should implement it further. You probably will put some standard control
on your UserControl, give it Index=0 (to use it like control array) and
alter its appearance in response on changes in Button object.
You can even avoid creation of class Button and use array of standard
CommandButtons (I use it just for example - it can be any other control) to
be stored in the Buttons collection. In this case in you Add and Remove
method you will use Load and Unload statements (or Visible property for
control with Index=0).

There are a lot of different ways (and related issues) to make it. Read VB
documentation related to Collection classes. There are definitely specifics
of using it for Control creation, but idea is still the same.

Good luck.
Dmitriy Antonov.

> I am creating a ActiveX Control in VB. But I cann't create
> groups like Toolbar's Buttons or StatusBar's Panel.
[quoted text clipped - 7 lines]
>
> Note: I'm useing VB6
Arunan - 25 Nov 2003 11:22 GMT
I'm creating a Calendar Control in VB. It has 40 labels. I
has create these labels as a array and named “DateCell”
So I want to group. So how to group it like a toolbar’s
button or Tab Bar’s tab.
If  you know it please send code please
E.g.:
    CalenderContro1.DateCell (0).ForeColor = VBRed

>-----Original Message-----
>I think, you need to create two additional classes within your ActiveX
[quoted text clipped - 45 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.