Solved

Visual Basic 5.0 Toolbar/Menu Style

Posted on 1998-08-08
26
347 Views
Last Modified: 2013-11-25
Dear Experts,
   How do you create a Toolbar and Menu that have the same style as in Visual Basic 5.0?  Such as having it raise up when you pass over the image, or in the Menu, it has pictures next to some of the words.  I'm looking for code.  Please help.
-xTrEaSoNx-
0
Comment
Question by:xTrEaSoNx
  • 14
  • 5
  • 2
  • +3
26 Comments
 
LVL 2

Expert Comment

by:percosolator
Comment Utility
go here.

http://www.mvps.org/vbnet/

Go to "Code Library", "Common Control Routines"

find the link "Changing a VB Toolbar to a Rebar-Style Toolbar"

there is code and examples.


0
 

Author Comment

by:xTrEaSoNx
Comment Utility
percosolator,
   That example was part of what i needed.  But i really need to know how to put images in the menu's.  Ex: a disk next to the 'New' located in a file menu.  Do you know where there is an example for this?
-xTrEaSoNx-

0
 
LVL 2

Expert Comment

by:percosolator
Comment Utility
Put an image list on the form.  Load the image list with your desired images.

Set the "Image List" property of the toolbar to your image list (select your toolbar, press F4).

Assign the appropriate index to each button.


0
 

Expert Comment

by:topol
Comment Utility
This is not 20-point question.
0
 

Expert Comment

by:wsanchez
Comment Utility
topol. This may not be a 20-point question but EE's not just for getting points but for helping out people with their problems.

xTrEaSoNx, I'm also looking for a way of implementing menus like the ones in VB 5.0.  I read something about the CommandBar control and it says that the CommandBar can make the Office-like menus and toolbars but from what I read, I think it's only for add-ins.  I'm still looking for a way to implement that menu and toolbar style but right now I have code for a substitute for the toolbar.  Just go to

    http://www.experts-exchange.com/topics/Q.10061288

It's a question I posted about Coolbars and an expert gave me a shorter code for implementing one.
0
 

Expert Comment

by:wsanchez
Comment Utility
pardon the grammar.  it should be "helping people out with their problems."
0
 

Expert Comment

by:topol
Comment Utility
About images on the menus: go to http://www.cyberhighway.com/~psy/vbthunder/index.html
Click on the Source Code link. What you need is the very first example, called OwnMenu4.zip.
0
 

Expert Comment

by:topol
Comment Utility
Why are you so picky about your grammar?
0
 

Expert Comment

by:topol
Comment Utility
I've got a question about grammar: what if I needed to put something like prepositional phrase inside "helping people _____ out with their problems"?
For example, "helping people with headaches out with their problems? That is awful. I think you should just leave out "out" in this and previous cases.
0
 

Expert Comment

by:wsanchez
Comment Utility
topol,  please don't take my comment personally. I too would like to know the answer to this question but I just don't like the idea that someone who knows an answer wouldn't give it because the question is priced very low.  I'm not hitting you on this.  I just want to see the people in this site give answers or comments not because of the points but because they would like to help.  Now, please forgive me if I have offended you.

About the grammar, I just noticed the error it right after I posted the comment.  I wanted to correct it but I can't go back to it so I just posted another comment.  It's not to give emphasis on my comment but just to correct it.

I would also like to thank you for your help even though this is not my question.   The source code would also be of help to me.
0
 

Expert Comment

by:topol
Comment Utility
You welcome
0
 

Author Comment

by:xTrEaSoNx
Comment Utility
Dear Experts,
   I've been reading your comments to this question, and I'd like to make something clear.  The reason this question is worth 20 points, is...
a) I thought it would be a simple answer, yet it involved a certain VB5 trick I was unaware of.
b) I prevously asked a hard question, which inturn, drained my points.  I had but only 30 points when I first posted this question.  I will be more than happy to raise the point value if it means that much to you.  But if you think about it, all of us are benifiting from this question.  Those of you who are trying to help, yet do not know the exact answer will find out yourself, and I will be finding out the answer.
   Topol,  
  I went to the site and downloaded that source code.  As of right now I have not had the time to try it out, but if it works I thank you very much, and I will award you with the points.  If it's not really what I'm looking for, I will continue to let this question go in hope that it will be answered.
-xTrEaSoNx-
P.S - I do not have the best of grammer/spelling skills.  So please do not start to critisize.  Thanks!
0
 

Expert Comment

by:topol
Comment Utility
He he. When i said "it is not a 20-point question", i meant that this question is worth no more than 10 points.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Expert Comment

by:wsanchez
Comment Utility
topol,

     I have tried out the source code and I can't seem to make it run properly.  It creates a GPF or sometimes a stack overflow.  Have you tried it out yourself?  If you have, did it work?  I think the problem's with

 wlOldProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf OwnMenuProc)

  in the cmdPicMnu_Click() sub.  Do you know a solution for this problem?
0
 

Expert Comment

by:topol
Comment Utility
Well, i did try this source code, and it worked fine, but that was previous version of it. I will download it and try.
0
 

Expert Comment

by:topol
Comment Utility
Yeah... I just downloaded the code and tried to run it.
It gives off the following error: fault# 0000005 in OLEAUT32.DLL at address 014f:65341c47. I have already emailed the author regarding this problem.
0
 

Expert Comment

by:topol
Comment Utility
Latest news: I found out exactly what line is causing crashes.
It is the first call of CopyMem in MsgProc.
The line is:
      Call CopyMem(DrawInfo, ByVal lParam, LenB(DrawInfo))
There are two other calls of this API, and i think the problem is in wrong arguements.
0
 

Expert Comment

by:topol
Comment Utility
I am sorry: just wanna add, that those two lines are working fine.
0
 

Expert Comment

by:topol
Comment Utility
Another update: RtlMoveMemory function simply moves the some chunk of memory from one location to another. It is just like pointer operations in C.  I see now why it creates GPF. I tried to substitute it with RtlCopyMemory, but it told me that there is no such entry in Kernel32.dll, though it is documented and must be there.
0
 

Expert Comment

by:wsanchez
Comment Utility
topol,
     thanks for taking the time to fix the problem. sorry I can't help in debugging it since I'm not that familiar with APIs and windows programming.  


0
 

Expert Comment

by:topol
Comment Utility
Woo.... I found the problem. In the line i mentioned above, it should read
       Call CopyMem(DrawInfo, ByVal lParam, LenB(lParam))
instead of
       Call CopyMem(DrawInfo, ByVal lParam, LenB(DrawInfo))
Here comes the pain: another problem, but not so severe as the previous one. In the same procedure, the line #30 from the end (counting comments) generates "Subscript out of range".
The line is
  hPrint .Left + 25, .Top + 3, Caps(DrawInfo.itemID), lTextColor
0
 

Expert Comment

by:topol
Comment Utility
By the way, if you changed RtlMoveMemory to RtlCopyMemory in your declaration, change it back.
0
 

Expert Comment

by:Snell
Comment Utility
Is this English or Programming? I cant remember...
0
 

Expert Comment

by:topol
Comment Utility
Snell,
This is programming


0
 

Expert Comment

by:mskannan
Comment Utility

Hi friends,
If you want the code for the above problem, just open a new project in VB5.0 and wizard will ask for what type of form you want, choose explorer style instead of standard style.

In the explorer style form, you have all the toolbars and menus as you wanted. I think this code will be useful to you.Hope this works for you.

If this is not the answer you are expecting then sorry I don't know more about your problem.

Regards,
mskannan.
0
 

Accepted Solution

by:
Snell earned 20 total points
Comment Utility
try the ocx on this page, It lets you do a LOT of things to your menu...

http://www.fileking.com/vb95.htmhttp://www.fileking.com/vb95.htm

look where it says something about a Toolbar (scroll down a lil)

-Snell

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now