• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

Visual Basic 5.0 Toolbar/Menu Style

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
xTrEaSoNx
Asked:
xTrEaSoNx
  • 14
  • 5
  • 2
  • +3
1 Solution
 
percosolatorCommented:
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
 
xTrEaSoNxAuthor Commented:
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
 
percosolatorCommented:
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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
topolCommented:
This is not 20-point question.
0
 
wsanchezCommented:
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
 
wsanchezCommented:
pardon the grammar.  it should be "helping people out with their problems."
0
 
topolCommented:
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
 
topolCommented:
Why are you so picky about your grammar?
0
 
topolCommented:
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
 
wsanchezCommented:
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
 
topolCommented:
You welcome
0
 
xTrEaSoNxAuthor Commented:
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
 
topolCommented:
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
 
wsanchezCommented:
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
 
topolCommented:
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
 
topolCommented:
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
 
topolCommented:
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
 
topolCommented:
I am sorry: just wanna add, that those two lines are working fine.
0
 
topolCommented:
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
 
wsanchezCommented:
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
 
topolCommented:
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
 
topolCommented:
By the way, if you changed RtlMoveMemory to RtlCopyMemory in your declaration, change it back.
0
 
SnellCommented:
Is this English or Programming? I cant remember...
0
 
topolCommented:
Snell,
This is programming


0
 
mskannanCommented:

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
 
SnellCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 14
  • 5
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now