Important alert: (current site time 7/16/2013 2:41:42 AM EDT)
 

winzip icon

McToolBar 1.4 - [ Advanced, Ownerdraw, SingleFile'd, XP style ToolBar ] (**Updated 14/10/05**)

Email
Submitted on: 10/13/2005 3:43:59 PM
By: JJJJJJJJ  
Level: Intermediate
User Rating: By 39 Users
Compatibility: VB 6.0
Views: 23221
(About the author)
 
     This is an advanced, single file'd, ownerdraw toolbar with, XPstyle/Normal HoverEffect, Custom ToolTips with balloon style and icons, Unicode support, fully customizable Gradient effects, Tiled background and many more... It is stylish, customizable and easy to use. The control does not use any property pages for item manipulation! All the opeartions can be done directly from the vb's property window. I think it is a well packed control with the most powerful routines. Chek this first release (may contain bugs)... and give me ur valuable feedbacks and comments!!! Jim Jose :-))

 
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 43 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 Intermediate 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

10/4/2005 5:16:39 PMThe_One

Awesome!
A++!
(If this comment was disrespectful, please report it.)

 
10/4/2005 5:31:26 PMCarles P.V.

PSC is collecting a nice UC collection :-) // Well done and quite well packed (2000 lines)! // Only a minor slip: check for a valid m_Button_Index in CreateTooltip routine (>-1). You can reproduce this in top *tool*bar. Clever use of WM_TIMER.
(If this comment was disrespectful, please report it.)

 
10/4/2005 5:39:55 PMVBtutor

Well done Jim .. I admire all ur posts .. Keep the good work ... as for me I give you 7 (*******)
(If this comment was disrespectful, please report it.)

 
10/4/2005 5:46:57 PMCarles P.V.

Next is only a happy suggestion: It would be nice (this could be applied to all usercontrols) to allow user full control of renderings. I mean, allow for example the following (optional) events: OnBackgroundPaint and OnItemPaint, passing hDC, rectangle bounds and item state related information (selected, focused, disabled...). Some additional routines could be added to help on this (PaintHelper_XXX) like PaintHelper_RenderIcon... depending on usercontrol nature.
(If this comment was disrespectful, please report it.)

 
10/4/2005 6:00:35 PMjeremyxtz

Looks good but it looks like you haven't tested it with large or custom fonts... as autosize doesn't size properly on my machine.
(If this comment was disrespectful, please report it.)

 
10/4/2005 8:33:00 PMÙmega

Great Uc 5 gloves!

Error on:

Subscript out of range on the
Sub CreateToolTip()
on line If m_ButtonItem(m_Button_Index).TB_ToolTipText = vbNullString Then
(If this comment was disrespectful, please report it.)

 
10/4/2005 9:50:34 PMOption Explicit

Another great job Jim! I'll get back to you when I've explored this more in depth. It looks like you and I are engaged in a bloody and violent usercontrol war this month :-) I'm glad I got a head start - I needed it! - Matt
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:25:47 PMJim Jose

The_One,Carles P.V, VBtutor, Thanx a lot for ur commects.
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:28:35 PMJim Jose

Carles, giving more conrol over uc paint events is nice. I will try to implement this in the next update!. Thanks
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:29:58 PMJim Jose

Ùmega, I just got aware of this... will be corrected soon!
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:31:57 PMJim Jose

jeremyxtz, Yeah thats true, I didn't checked it for LARGE fontsizes!. Thanks for informing..
(If this comment was disrespectful, please report it.)

 
10/4/2005 10:38:37 PMJim Jose

Matt, bloody war?? :)) Hey, I was not at all planning about this before 2 days... I was done very quick to use in my another project. Also I wish to thank to u , bcose I got aware of Carles's bitmap tiling code from u!! Thanks a lot!!
(If this comment was disrespectful, please report it.)

 
10/5/2005 12:22:05 AMHeriberto Mantilla Santamaria

Hi Jim.

An observation.

1) It revises when the mouse is outside of an item of the toolbar, procedure CreateToolTip produce the error 9.
(If this comment was disrespectful, please report it.)

 
10/5/2005 12:25:04 AMHeriberto Mantilla Santamaria

Sorry I forget a suggestion.

When the style is XP, you could add a shade to the image it's much more impressive.
(If this comment was disrespectful, please report it.)

 
10/5/2005 2:05:57 AMLuthfi

Nice one,
just a little suggestion.. it would be great if you could put support for design time button_index selection with mouse button.
(If this comment was disrespectful, please report it.)

 
10/5/2005 6:38:38 AMRichard Mewett

Jim - do you ever sleep? :)
Another great control and 5* from me. I love the use of WM_TIMER over a Timer control.
(If this comment was disrespectful, please report it.)

 
10/5/2005 6:46:18 AMLight Templer

Jim, you've got a lot of 5s for this great control. My five are especialy to thank you for the hard work you put into the detailed demonstration. Doing a fine control AND making a good demo for it, thats the art! ;-)
Regards - LiTe
(If this comment was disrespectful, please report it.)

 
10/5/2005 6:53:16 AMThe_One

Also, a little bug i found, (Might be just my system) But when the top (Horizontal) Toolbar is dragged, the application crashes.
(If this comment was disrespectful, please report it.)

 
10/5/2005 7:34:47 AMJim Jose

Heriberto, adding icon shadow will be nice. Let me try... Thanks for ur suggessuion!
(If this comment was disrespectful, please report it.)

 
10/5/2005 7:38:16 AMJim Jose

Luthfi, the idea of allowing mouse events is great! but it recures design subclassing, which is not working with Paul Cartons self subclasser code. For that we need an extra module and can only be used as compiled ocx (not with in the project).
(If this comment was disrespectful, please report it.)

 
10/5/2005 7:43:10 AMJim Jose

Richard, thants the thing I most loves! I am notorious to wake up after 8.00am morning! :)
(If this comment was disrespectful, please report it.)

 
10/5/2005 7:46:44 AMJim Jose

LiTe, "Art of programming??" nice comment!. I wend for a bit more detailed demo bcose, the functionality is not so common (even if it is very simple to understand!)
(If this comment was disrespectful, please report it.)

 
10/5/2005 7:52:39 AMJim Jose

The_One, I never got such an error! Me too like to think this happens only on ur system! :)
(If this comment was disrespectful, please report it.)

 
10/5/2005 8:43:51 AMTerriTop

Jim, One word....Kick'in. Keep up the great work! TerriTop
(If this comment was disrespectful, please report it.)

 
10/5/2005 10:15:18 AMFred.cpp

when you move the mouse over the control and the container form is not the active window It Is activated. this is for the topmost position on the tooltip. If you remove It It works fine.
It's a very nice control, you did It again, congratulations.
a small suggestion Is to give It WinXP Theme properties (with Uxtheme.dll)
Regards
(If this comment was disrespectful, please report it.)

 
10/5/2005 10:43:34 AMCarles P.V.

Probably more urgent features are: Enabled (whole toolbar) and ButtonEnabled().
(If this comment was disrespectful, please report it.)

 
10/5/2005 2:47:50 PMJim Jose

Yes carls, i am aware of it, and I am working to include that on the next update!
(If this comment was disrespectful, please report it.)

 
10/5/2005 3:46:12 PMHeriberto Mantilla Santamaria

Hi Jim, this small piece of code Draw a shadow effect.

isValue = CreateSolidBrush(RGB(136, 141, 157))
Call DrawState(UserControl.hDC, isValue, 0, isPicture.Handle, 0, iX, iY, isPictureSize, isPictureSize, isType Or DSS_MONO)
(If this comment was disrespectful, please report it.)

 
10/5/2005 9:41:42 PMJim Jose

Heriberto, Thanks! Its a great tip and helped a lot!
(If this comment was disrespectful, please report it.)

 
10/5/2005 10:57:48 PMÙmega

i wish you could add a separator feature...
(If this comment was disrespectful, please report it.)

 
10/6/2005 8:38:58 AMPaul Caton

Jim, nice control, 5*! I haven't had much time for PSC (or VB for that matter) lately, but I'm trying to work up a new release of the self-subclassing UserControl. I'll take a look to see if design-time subclassing is feasible.

BTW, it's Caton, not Carton
(If this comment was disrespectful, please report it.)

 
10/6/2005 1:11:18 PMImam Gunawan

5 globe from me... very very good
(If this comment was disrespectful, please report it.)

 
10/6/2005 4:01:47 PMHeriberto Mantilla Santamaria

Thanks to you Jim...
(If this comment was disrespectful, please report it.)

 
10/6/2005 4:10:18 PMJim Jose

Paul Caton, Ooops... Sorry! my mistake :) I am very happy to see u here. Yeah, it will be a huge advantage if self-subclasser can support design time subclassing. It can create a new generation of usercontrols!. And thx for voting!
(If this comment was disrespectful, please report it.)

 
10/6/2005 8:07:27 PMJames Miller

Jim, Very nicely done!!! Thanks Millions for this !!! May I use this commercially?
***** from Me
James
(If this comment was disrespectful, please report it.)

 
10/7/2005 3:43:21 AMRiccardo Cohen

Nice one again Jim, but when the top (Horizontal) Toolbar is dragged and then mouseover, the happens an error.

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

 
10/7/2005 7:55:47 AMtr0piiic

Just add somes states for buttons like : tbrUnpressed, tbrPressed and i give you 5/5 ;-)
(If this comment was disrespectful, please report it.)

 
10/7/2005 9:22:23 AMTheCardinal

Run-time error 91, keep getting this error, why?
(If this comment was disrespectful, please report it.)

 
10/7/2005 10:32:31 AMJim Jose

James, Thanks! Yeah, Its my pleassure to allow you. You can use it in any of ur projects :)
(If this comment was disrespectful, please report it.)

 
10/7/2005 1:03:46 PMJim Jose

Riccardo, So that error is not only for "The One". I will thick seriously on this... Thanks for informin :)
(If this comment was disrespectful, please report it.)

 
10/7/2005 1:11:04 PMJim Jose

tr0piiic, I am a little bit confused with this part. Since the control is taking the full advantage of vb's property window, a large number of options(properties) may feel messy!. But, button states are often needed and I will try to add it (without much complications) :)
(If this comment was disrespectful, please report it.)

 
10/9/2005 2:39:07 PMHerman

I appreciate a lot of the cognisance that a user control should not be unduly complicated to use. However, this control fails some basic test. Putting aside the discussion on features, any user control should meet the basic requirements: (i) good on both non-XP and XP platforms and (ii) good on Small and Large Font Windows settings. This control has not met the basic requirements yet.

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

 
10/9/2005 6:54:02 PMHeriberto Mantilla Santamaria

Hi Herman.

I don't agree since with you this control still this in development (for my your requirements are applied, but the control can improve more), but of something I'm sure it's that the friend Jim is improving it with passing of the time.
(If this comment was disrespectful, please report it.)

 
10/10/2005 2:16:54 AMJim Jose

Herman, I know this control is not perfect. But please understand it is the first release of this control and still is in development. There is a lot of improvement (shadow, pressed state,enable, win98 style & including some u suggested) for the unreleased version. I was temporarly out of this project, so I could not release the new version 1.4. Also I wish to make a VALID upgrade for this control other than get messed with a lot of updates! Anyway the new version (1.4) will be released soon.....
(If this comment was disrespectful, please report it.)

 
10/10/2005 5:05:56 PMCodeFester

Not sure if you are already aware of this but if you hover the mouse over the top toolbar beyond the last button (on right) then you get an "Index out of bounds" error in the CreateToolTip routine on the control... Looks great though and I will 5 it.
(If this comment was disrespectful, please report it.)

 
10/13/2005 10:02:27 PMJim Jose

Hi guys, the new version 1.4 is just released! I tried consider almost all ur feedbacks. Now the control has WIn98 styles... but there is no real seperation b/w XpStyle and Win98 style(ie, u can set appearnace for both these, by simply changing some related properties). I am planning one more version(1.6) which will support "Seperators" and "PopUpMenus".
(If this comment was disrespectful, please report it.)

 
10/15/2005 7:14:31 AMRiccardo Cohen

Nice upgrade and realy nice ideas for version 1.6. But here is a minor bug now:
Do mousedown on toolbar a button, hold it and move mouse out of toolbar, now release mouse button. now go mouse over the same toolbar. The mouse over effects doesn't work anymore (Picture).
Thx for the great works...
(If this comment was disrespectful, please report it.)

 
10/15/2005 6:17:42 PMSnerf

One extra thing that is needed, is that if the toolbar is longer or higher then the form, you can not access the hidden buttons. It needs chevrons or such to scroll to those buttons. Otherwise, fantastic work.
(If this comment was disrespectful, please report it.)

 
10/15/2005 8:42:36 PMmichael doering

Hello Jim,
a very good control.
for your next update you planning 'PopUpMenus',
do you mean 'Chevrons' ?

thanks for the very good work.
(If this comment was disrespectful, please report it.)

 
10/16/2005 6:47:36 AMJim Jose

Ooops... What u mean by 'Chevrons'??? I just wish to give the menu generating option that u can see on Windows Explorer's "Back" and "Forward" buttons on toolbar!!
(If this comment was disrespectful, please report it.)

 
10/16/2005 5:28:40 PMmichael doering

Hello Jim,
you can see 'Chevrons' when the IE
is smaller as the last Button from the Toolbar, this '»' char is visible.

>"Back" and "Forward"
also very good, but these are two different kinds of buttons

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

 
10/18/2005 10:36:32 AMAnibal Sarasua

Hi jim Excellent work(*****), i added a property pages to the porject to help me in the desing of the toolbar and compiled it in ocx type, im added a new property called ButtonKey as String, that help me in Click Event to select a Button from string that identify this.
(If this comment was disrespectful, please report it.)

 
10/24/2005 8:53:44 AMJim Jose

Anibal, If u wish to use the control as an ocx... then a property page is the right solution. I just tried to make it useful compiled with the project!. Anyway good work! I appreatiate all the developments on this control :) Jim Jose
(If this comment was disrespectful, please report it.)

 
10/28/2005 1:25:24 AMSnerf

I do hope you are planning on adding Chevrons (arrows) for the next release, in case the toolbar does not fit on the form, because it is too wide.
(If this comment was disrespectful, please report it.)

 
11/4/2005 2:18:15 AMPaul Mendoza - Phil

ok very cool program a user control only.. nice
(If this comment was disrespectful, please report it.)

 
11/13/2005 6:08:23 PMOption Explicit

Congrats again Jim! Two for two!
(If this comment was disrespectful, please report it.)

 
11/15/2005 8:42:43 AMRichard Mewett

Well done on COTM Jim! :-D
(If this comment was disrespectful, please report it.)

 
11/25/2005 5:19:16 AMsantos grg

This is wat i needed but it creates some problem!!but not huge!!

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

 
11/26/2005 1:49:23 AMJim Jose

I know there is lot more to improve. I will post a new version for this control rewriting all the drawing routines from scrach!! The new version will be with multi-interface (win98,xp,flat,java and many more)
(If this comment was disrespectful, please report it.)

 
1/6/2006 12:44:18 PMJim Jones

Exceptional work. Looking forward to any updates. One improvement would be to allow the each button to be sized separately. This would allow for longer captions to be displayed to the right of icons better and more uniformly.

Nice work.

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

 
1/26/2006 4:23:31 AMYoga_Raj

May the code elves grant you an academy award for superb code works. Its nice to learn your work
(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.