Important alert: (current site time 7/16/2013 3:50:28 AM EDT)
 

winzip icon

Advanced VB Based Toolbar ActiveX Control

Email
Submitted on: 2/2/2000
By: Richard Moss  
Level: Advanced
User Rating: By 33 Users
Compatibility: VB 5.0, VB 6.0
Views: 69900
(About the author)
 
     This is a complete commericial quality toolbar control for use with VB6 (VB5 users will need to create replacements for Replace and Split functions). It is completly owner drawn, and has no requirements on Common Controls, IE or whatever. As much as possible, API is used to greatly enhance and optimise the control. Buttons can be standard buttons, seperators or placeholders. Each button can have hover and down pictures, as well as alignable caption text. Virtually everything can be customised, include the colors of the toolbar itself. It also has several other code which would be of use for applications, such as file and colour common dialogs via the API, complete API driven graphics routines, and an extended graphics manipulation class. Includes complete documentation in the form of a CHM file, code is commented where appropriate as well. Note: This is advanced code and not really of much use for beginners, although it does include lots of common routines which you could use in your projects, as well as several standard modules. Vist the Cyotek website at http://www.cyotek.com/ for more ActiveX controls.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

2/2/2000 1:20:01 PMOmar

Very Good. This Certainly deserves an award. Keep it up.
My God Bless you.
(If this comment was disrespectful, please report it.)

 
2/2/2000 4:13:28 PMvbguy

this thing rocks!!!! Execellent JOB!
(If this comment was disrespectful, please report it.)

 
2/2/2000 7:50:24 PMC.Y.SU

OH! Very Very Good!

Thank You..........

(If this comment was disrespectful, please report it.)

 
2/3/2000 4:04:38 PMn/a

what do you mean vb5 user will have to creat replacment for the Split part?
(If this comment was disrespectful, please report it.)

 
2/3/2000 10:43:14 PMlvinniel

First of all, I applaud the fact that you have submitted this commercial quality product to an open source site like PSC. Secondly, I briefly looked at the control and I would like to save myself some time and ask you if your control's design allows a user to place other control's (i.e. combo box) on the toolbar? Thanks again...
(If this comment was disrespectful, please report it.)

 
2/4/2000 2:03:45 AMRichard Moss

Yes, you simply set the Style of the button to PlaceHolder, specify the PlaceHolderWidth, and then use the Toolbar's Resize event to correctly position your control within the boundaries of the button.
(If this comment was disrespectful, please report it.)

 
2/4/2000 3:57:19 AMPete Cozens

What can I say that hasn't already been said? This obviously took an awful lot of work, and you are to be commended on both the quality of your code, and your generosity for sharing it.
(If this comment was disrespectful, please report it.)

 
2/4/2000 9:45:31 AMUkrit

Verry Good!
(If this comment was disrespectful, please report it.)

 
2/6/2000 4:22:44 PMJazmine

Very Nice and Very Professional. One of the Best Active X Control Code on this Website. Thank you for sharing your knowledge. I know Like Myself and Evryone else would learn alot from you hard work.

Very Good
(If this comment was disrespectful, please report it.)

 
2/25/2000 11:20:46 PMMark Strange

This control kicks 100% of the RDA of ass! Nothing short of top notch professional quality work, I sincerly applaud your efforts. They paid off big-time!
(If this comment was disrespectful, please report it.)

 
2/27/2000 9:45:59 AMKyle Sluder

I've doenloaded the complete set of common controls from Ariad (Richard Moss's company), and they are completely and totally excellent! Somebody actually offers some decent toolbar code for free, and it WORKS! Thanks, Richard.
(If this comment was disrespectful, please report it.)

 
3/3/2000 1:57:47 AMRichard Moss

Thank you to all those who have voted for my code, allowing it to receive the Code of the Month award. Watch this space, so more advanced code will be coming along soon...
(If this comment was disrespectful, please report it.)

 
3/3/2000 5:04:33 PMWOW

Wow is all I can say, because I have never seen something this great, and FREE, for a very long time!
(If this comment was disrespectful, please report it.)

 
3/19/2000 3:03:44 AMErik Forbes

Very professional code. This is the kind of code that makes Planet-Source-Code work for the masses. Keep up the great work!

Erik Forbes, NiftySoft
(If this comment was disrespectful, please report it.)

 
4/17/2000 4:31:52 AMTim Green

Go you GO yo!!!!Go you GO yo!!!!Go you GO yo!!!!Go you GO yo!!!!Go you GO yo!!!!Go you GO yo!!!!Go you GO yo!!!!
(If this comment was disrespectful, please report it.)

 
4/18/2000 7:44:46 AMNABUSHAR

very execellent man
(If this comment was disrespectful, please report it.)

 
5/11/2000 11:24:20 PMRobert Ogrisek

One of the best tools I have seen.
(If this comment was disrespectful, please report it.)

 
8/5/2000 3:10:31 PMJason

Great Code! You are a very good programmer. Thanks for the control
(If this comment was disrespectful, please report it.)

 
12/5/2000 1:10:19 PMhumph

great code, actually look 20 seconds to download! but i cant seem to get it to work with vb5, cant load project because of "retained" error and so i made the project and added all the files, and it gives a "method or data member not found" error on almost every line of it. does it only work with vb6? if so i think i need to get vb6 for this :) any help would be appreciated, thanks!
(If this comment was disrespectful, please report it.)

 
12/24/2000 5:53:57 AM[-FuRy-]

I may be a bit late but this code is still great! Does anyone know how to delete a button using the key instead of the index. This is because in a MDI I need to delete buttons according to the windows which each have specified tags like 1, 2, 3, 4, ...etc.
Thanks!
(If this comment was disrespectful, please report it.)

 
12/26/2000 2:39:26 PMRichard Moss

The DeleteButton method does support using Keys as Indexes, using the public function KeyToIndex to determine the key.

However, it does not support keys that are numeric - these are treat as index numbers. In order for the Key property to be used correctly, this should be a non-numeric value.
(If this comment was disrespectful, please report it.)

 
12/26/2000 5:24:07 PMsabre

a truly magnificant peace of work
5 globes
(If this comment was disrespectful, please report it.)

 
2/8/2001 1:38:17 AMSyntax

Simply awesome!
(If this comment was disrespectful, please report it.)

 
3/5/2001 11:02:52 PMabonstu

i thought it was a little buggy actually, when in 'flat' mode you cant click repeatedly, the buttons have a sluggish feel and the property page is a doesnt work properly (the 'Play Sounds' checkbox doesnt work). but apart from all that, its seems pretty competent, very customisable, well done.
(If this comment was disrespectful, please report it.)

 
6/30/2001 3:32:30 PMSaleem

Amazing code! You are a really good programmer. This site needs people like you. The visuals are above and beyond anything at all. All I can say is WOW! Great code....and fully commented. There are very few people like you to say the least.

Keep up the great work.
(If this comment was disrespectful, please report it.)

 
6/30/2001 3:35:29 PMRichard Moss

Thank you, it is nice to know that this code is still appretiated by other programmers.
(If this comment was disrespectful, please report it.)

 
6/18/2002 8:14:36 AMCalvin

Excellent piece of work, however the button captions do not display correctly, if at all. But I'm not complaining just giving a heads up on the bug. Keep up the good work!
(If this comment was disrespectful, please report it.)

 
7/18/2002 2:01:14 PMCarlos Vara

Hi!, how are you, I hope you are fine.

Very Nice work! Congratulations!

I'm traying to do something similar but very restricted toolbar to some programs I develop, but
I have a big problem and I don't now how to fix it, let me explain it to
you :

Note 1 :
I Develop an compile the project under Windows 95 PC And is distributed to computers runing under Windows 2000 and Windows XP.

Note 2 :
I compile the project under Windows XP and Windows 2000 and the error
don't appear.

Note 3 :
I add the DLL project to my base project and run it step by step and the
error don't appear.

If I missed something, please contact me : cavarped@ccm.femsa.com.mx or
lordvara@hotmail.com


(If this comment was disrespectful, please report it.)

 
7/18/2002 2:02:59 PMCarlos Vara

I Develop an ActiveX DLL that creates a Toolbar inside a form, my dll have
a function that you can call to create that toolbar, next I will show you
the arguments in the function inside my DLL.

Dim WithEvents tb as MSComctlLib.Toolbar
----------------------------------------Public Function CreaToolbar(ByRef Forma as Object)
Set tb = Forma.Controls.Add("MsComctlLib.Toolbar", "ToolbarName"
With tb
tb Attributes...
.
..
...
End With

End Sub

Private tb_ButtonClick( ByVal Button as MSComctlLib.Button)
Actions...
End Sub
-----------------------------
I referenced my dll and I call the DLL function from my base project :

Public WithEvents tlb As DLLName

Private Sub Form_Load()
tlb.CrearToolBar Me
End Sub


(If this comment was disrespectful, please report it.)

 
7/18/2002 2:03:21 PMCarlos Vara

Under my PC run very fine but when I compile an distribute it an error
appears.

"Type Mismatch" just in the fist line when I create the toolbar, I revised
the type returned by the right hand that will be assigned to "tb object"
and is the same in other machines.


(If this comment was disrespectful, please report it.)

 
3/6/2003 7:00:06 AMTim Hill

I had a problem with the control. Seemingly randomly the control would crash my VB project, either while running in VB or standalone, with the following error

MCI command handling window:vb6.exe - Application Error

The exception Integer division by zero.
(0xc0000094) occurred in the application at location 0x77f779b8.


The problem would only happen randomly on a toolbar button click. Thanks to information from another web site I managed to trace this to the an API call which is used to play a sound on a button click. I have commented out the code which calls this and the problem seems to have gone away. (Windows 2000 SP2, VB6 SP5)
(If this comment was disrespectful, please report it.)

 
3/6/2003 7:11:26 AMRichard Moss

Tim,

Yes, this was a problem when running the control on Windows NT bases systems - as this control was developed on Windows 95, the problem never became apparent until a while after release. A fix is to define the byte variable in the play sound method as Static rather than Dim, and it will work fine.
(If this comment was disrespectful, please report it.)

 
7/6/2004 9:24:45 PMFranco Zapata

It's very good
(If this comment was disrespectful, please report it.)

 
9/30/2004 8:36:42 AM

Its excellent. Your toolbar solves my problems with the limitations of microsofts toolbar which does not allow you to change any aspect of its color!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.