473,320 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Any way to allow F1 help for menu items in VB.NET?

In VB6, I used a system, which I loved, whereby I assigned a "helpId" to each
menu item; that way, you could rest the cursor on the item (without actually
running it) and then press F1 to get context help with that particular
command.

In VB6 this was easy, since each menu item had a "helpId" property. That
doesn't seem to be the case in VB.NET. Am I wrong about that, or
(alternatively) is there some other way to accomplish this?

--
Thanks.
ro*****@hotmail.com
Jun 4 '06 #1
4 4112
Bob,

I don't know what you want to do, but every menuItem in Net 2.0 has a tag
item from the type item.
You can in fact millions of fields put in that by creating a class and
instance that as object.

http://msdn2.microsoft.com/en-us/lib....menu.tag.aspx

In your case it is probably not even needed and can you just put a string in
it.

Cor

"Bob Homes" <ro*****@hotmail.com.(nospam)> schreef in bericht
news:03**********************************@microsof t.com...
In VB6, I used a system, which I loved, whereby I assigned a "helpId" to
each
menu item; that way, you could rest the cursor on the item (without
actually
running it) and then press F1 to get context help with that particular
command.

In VB6 this was easy, since each menu item had a "helpId" property. That
doesn't seem to be the case in VB.NET. Am I wrong about that, or
(alternatively) is there some other way to accomplish this?

--
Thanks.
ro*****@hotmail.com

Jun 4 '06 #2
Cor,

But how can you find out if a user is pointing to a particular menu item
(not selecting it, just resting the cursor on it) -- so that you can display
the correct help topic just be pressing the F1 key? (or alternately, pressing
some other function key, if F1 is dedicated to VbNet's help object)?
--
Thanks.
ro*****@hotmail.com
"Cor Ligthert [MVP]" wrote:
Bob,

I don't know what you want to do, but every menuItem in Net 2.0 has a tag
item from the type item.
You can in fact millions of fields put in that by creating a class and
instance that as object.

http://msdn2.microsoft.com/en-us/lib....menu.tag.aspx

In your case it is probably not even needed and can you just put a string in
it.

Cor

"Bob Homes" <ro*****@hotmail.com.(nospam)> schreef in bericht
news:03**********************************@microsof t.com...
In VB6, I used a system, which I loved, whereby I assigned a "helpId" to
each
menu item; that way, you could rest the cursor on the item (without
actually
running it) and then press F1 to get context help with that particular
command.

In VB6 this was easy, since each menu item had a "helpId" property. That
doesn't seem to be the case in VB.NET. Am I wrong about that, or
(alternatively) is there some other way to accomplish this?

--
Thanks.
ro*****@hotmail.com


Jun 4 '06 #3
Bob,

If you are using .NET 1.x you provide help trapping the MenuItem Select
event:

Private Sub MenuItem2_Select(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MenuItem2.Select

MessageBox.Show("Found")

End Sub

If you are using .NET 2.0 and the ToolStripMenu you can provide help by
trapping the ToolStripMenuItem MouseEnter event:

Private Sub CutToolStripMenuItem_MouseEnter(ByVal sender As Object, ByVal e
As System.EventArgs) Handles CutToolStripMenuItem.MouseEnter

MessageBox.Show("found")

End Sub

"Bob Homes" <ro*****@hotmail.com.(nospam)> wrote in message
news:03**********************************@microsof t.com...
In VB6, I used a system, which I loved, whereby I assigned a "helpId" to
each
menu item; that way, you could rest the cursor on the item (without
actually
running it) and then press F1 to get context help with that particular
command.

In VB6 this was easy, since each menu item had a "helpId" property. That
doesn't seem to be the case in VB.NET. Am I wrong about that, or
(alternatively) is there some other way to accomplish this?

--
Thanks.
ro*****@hotmail.com

Jun 6 '06 #4
Mike,

Thanks for the idea, its a good one (and I'll probably use it sometime --
I've always wanted to have a way to display a one-line help comment in a
status bar at the bottom of a window, when the user moves his mouse onto a
menu item. I don't think I could do that in VB6).

However, that's not what I am trying to do right now. I guess I didn't make
myself clear, because you're the second person to not quite see what I'm
trying to do. I think what I'm trying to do isn't being done by anyone else,
since I thought of it myself and have never seen any programs (other than my
own) that do this.

Here's the thing -- I want to be able to move my mouse over a menu item
(say, by opening the File menu, and moving down to the Exit item on the
dropdown), and then press the F1 key while the "Exit" item is highlighted
(but NOT clicked). In VB6, each menu item had a HelpContextId property, and I
would assign a number to that property of each menu item in the entire menu
system of my program. I would then write a HTML help system, with a help
topic assigned to each menu item (with a number corresponding to the
HelpContextId assigned to the menu item in the program). Then, the User could
highlight a menu item (such as File/Exit) and then -- WITHOUT clicking the
item, ie, not running the command represented by that item -- press F1 and
immediately see context help for that particular menu item. This was a great
way to write an entire HTML help system just by writing a help topic for each
menu item in the program. In fact, I wrote a program to automatically do most
of that. However, there doesn't seem to be any "HelpContextId" type property
for the individual menu items in a VB.NET program.

I don't think I can accomplish the foregoing by, as you suggested,
responding to the event of the User moving the mouse over a menu item. If
that were the case, the User would be getting help (even if he didn't want
it) every time he tried to select a menu item.

After getting your suggesting, I looked through the possible events for the
menu item object (if it IS an "object"), and I didn't seen any event that
would respond to the user pressing a key, whether it be F1 or any other key.
Thus, I don't think using an event to accomplish what I want is going to work.

Someone else responded to my question by suggesting that I use the TAG
property of the menu item. But he didn't explain how to use that to do what
I'm trying to do. I think what I'm trying to do can only be accomplished if
there is some way to allow the user to press a key while a menu item is
highlighted. Even if there was a way to do that, you would still have to know
what menu item was highlighted at that particular time, but I also don't know
how to determine that programatically.

If you have any further thoughts, I'd sure be thankful to hear them.

Thanks.
ro*****@hotmail.com
"Mike McIntyre" wrote:
Bob,

If you are using .NET 1.x you provide help trapping the MenuItem Select
event:

Private Sub MenuItem2_Select(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MenuItem2.Select

MessageBox.Show("Found")

End Sub

If you are using .NET 2.0 and the ToolStripMenu you can provide help by
trapping the ToolStripMenuItem MouseEnter event:

Private Sub CutToolStripMenuItem_MouseEnter(ByVal sender As Object, ByVal e
As System.EventArgs) Handles CutToolStripMenuItem.MouseEnter

MessageBox.Show("found")

End Sub

"Bob Homes" <ro*****@hotmail.com.(nospam)> wrote in message
news:03**********************************@microsof t.com...
In VB6, I used a system, which I loved, whereby I assigned a "helpId" to
each
menu item; that way, you could rest the cursor on the item (without
actually
running it) and then press F1 to get context help with that particular
command.

In VB6 this was easy, since each menu item had a "helpId" property. That
doesn't seem to be the case in VB.NET. Am I wrong about that, or
(alternatively) is there some other way to accomplish this?

--
Thanks.
ro*****@hotmail.com


Jun 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at...
8
by: Dennis C. Drumm | last post by:
Is there a way to modify the standard context menu shown when someone right clicks in a windows text box and that would work for all open windows applications? The standard context menu for...
6
by: Sandy | last post by:
Hello - I have a book that illustrates pulling menu items from a Sql Server table into an ascx via a stored procedure. Is this something that is done in the real world? I do like the effect...
1
by: goRide | last post by:
Hi, I'm looking of a way (preferred - a ready class or dll) to customize the context menu. many application has more controls inside the context menu (like textbox, sliders, checkbox, panel...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
2
by: MCM | last post by:
I'm working on a plotting control. The plotting control will have a context menu with basic commands for "scaling", "zooming", etc. Is there a way that, from the parent form, I can add more...
1
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, friends, I am using C#.net 2005 to create a windows application. It has menu items, such as File, etc. Under File, there are more menu items, such as New Files, Working Files, etc. Under...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.