Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Right-click In VB6 For Drop-down Menu

I apologize if this has been asked before but I do not even know what to call it.

I have a large VB program that has one main graphical form. It would be nice if I could implement a facility that emulates many modern Windows based programs. I would like to bring up a "Drop-Down" menu when someone right-clicks somewhere within the form. (Yes, I detect clicks and the right button, I just don't know what to do when I detect it) The dropdown menu would ideally be context sensitive. Can someone point me in the correct direction...perhaps just the name of this under VB6 would be helpful.

Kind Regards and Thank You.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Right Mouse Click Drop Down Menu
is there any code out there for creating a right mouse click menu?
so that you have the options like cut and paste?

Drag & Drop - Managing Mouse Events For Both Right-click Popup Menu & Right Dragging
OK - suppose I have "control1" and "control2". On control1, if the user right-clicks, I want to show a popup menu, but I also want to allow right-dragging to control2. If the user right-drags, I want to show a popup menu on the drop. How do I manage these events to keep things straight?

Everything's fine if I only allow dragging with the left button and popup menu on the right button. It's when I want to allow "double duty" on the right button that things get confusing.

Right-click Menu And Sending Left Click To Item
Can anyone tell me how I can use insert a right-click menu into my program so that when the user has selected a file (in a file list) and right-clicks, a menu appears at the location of the mouse pointer. I aleady know how to use the PopupMenu function to show a menu as I suppose that will need to be used, I just don't know how to capture a right-click mouse event and also use the position of the mouse pointer to show the menu.

Thanks in advance!

Disable MDI Parent's System Context Menu Right & Left Click Menu Pop-up. How?
I am trying to do this without much luck, but managed to get rid-of the Min/Max buttons via an MS example at the link below.;en-us;137033

However, when a user right clicks on-the MDI parent's Caption bar, a popup up menu appears - Woud like to prevent that.

Secondly, if a user "LEFT" Click on the top Left corner of the same Caption bar (where the Icon appears); it pops the same Pop-Up Menu - Like to stop that.

Thirdly, If a user double clicks on the same menu bar, form flickers, bobs down & up (Min & back to Max state), looks back at you and say's "fooled Ya!", as if it was possessed by some sort of strange evil code. Now I Would really, really, like to make it stop doing that.

Basically, like to prevent any mouse action on MDI Parent's Title Bar. Searched for couple of hours in vain (pain), but nothing turned up for what I am looking for. I can stop the right click on the form it-self by detecting mouse down button, but thatís not preventing the click event in MDI parent's title/caption bar.

Anyone know how or what needs to be done to get this to work? Any and all help, suggestions, etc. will be greatly appreciated!

Clicking Picturebox Show Menu, Click Elsewhere Disappear Menu
Hello Everybody,

I've soem pictureboxes, and I want to show too command buttons when you click on on of the images but if you click somewhere else I want to make them dissappear, I tried the form_click event, and from_mousedown even, but they only work when you click on the form, but I've loads of other things on it, so the user must be "lucky" to click on the form, but to put the code to make them disappear in every object of the form would take a lot of time and I wonderd if there was another way to make them disappear again after clicking on something else???(its not that I don't want to ut the code there because of the work, but if I didn't search for a better methods then I would stay at the same level of programming)

Add Custom Menu Item To Windows Right Click Context Menu ????
Hi everyone

Earlier today there was a thread with this Q in it but it wasnt ever resolved. What i want to do is add my own custom entry to the windows menu that pops up when you right click on an something in particular to the edit menu. So when you select some text no matter what app your in it has my custom menu option in it along with the usual copy and paste and what not.

Can this be done

If so how and where do i start ??

Runtime Menu/Right Click Menu/No Border Form
Ok, I am trying to make a form as small as possible. I turned on the boreders and its just the way I want it. Now I would like create a popup menu (to save space, instead of puting command buttons). The problem is, when I add an invislbe menu in the menu editor and try to use Popupmenu, borders and the title bar appear on my form even though borders are still set to none.

From the search I did there seems to be no way to create a run time menu without some APIs. Is there any other way to accomplish a right click menu in this situation? Thanks.

Adding Menu's In Windows Explorer Right Click Menu
Could anyone tell me how you can put a menu item of your own in, for example, the right click menu in windows explorer? I know it's possible , is anyone there listening to me ????? PLEASE HELP !!!!!!!

Popup (right-click) Menu From Standard Menu
I've searched and searched and cannot find any information on how to get a pop-up menu to appear when you right-click on a standard menu item. A classic example of this is in Internet Explorer's Favorites menu. If you right-click on a favorite, a popup menu appears and you can rename, delete, etc. the highlighted favorite. In VB6, accessing a menu item does not appear to fire the MouseUp or MouseDown events. Any thoughts?

How Easy Is It To Add To Context Menu (right Click Menu)
I'd like to be able to add to the context menu (right click menu), how is this possible? and is it restricted to the application i.e I'd like to add one to an Excel sheet and one to normal windows operations

How Can You Add The A Menu To An External App, Or A Right Click Menu Addon?
Like lets say i wanted to add a menu to outlook express, or to a right click menu popup.. anyone know how to do it?

Drop Down Box On Right Click

I have a spreadsheet that shows a drop down selection list on right click. This has not been done via the 'Data-->Validation' method it looks like VBA but the VBA code is password protected and the author is no longer contactable.

I have put a screen shot of it on the attached file, anyone know how to create this? Your help is greatly appreciated.


Right Click Drop Down
Hello all,

i'm using a treeview control in a browser type application.
Q; Does anyone know how i can achieve a drop down menu for a right click event within the treeview control?

i'm after configurable menu items such as 'cut, copy, paste, delete, properties etc...'

anyone got any ideas?


Menu Click = Picture Box Click
I have a strange problem. I have a picture box and when the menu drops down and I make a selection on it the picture box captures the event and fires the mouse click event. Normally this would be no problem but the mouse click depends on what is plotted and seeing as how nothing is plotted I get an error message. Nothing wrong with the error because nothing is printed.

Does anybody know how to get around this?

I hope I have explained it good enough!

Click - Drag - Drop
Hello, i know this is possible but very dificult.

How do i make a editor section of a program where you can place the buttons and control where you like? Click - Drag - Drop the objects onto a form.

Webbrowser Drop Down Click
The drop down box has 2 options:


Basically I check if the value is football, if it is i select basketball, and the page refreshes to the basketball options

This is the code that used to work:

VB Code:
If (web.Document.Forms(0).Item(8).Value = "0:FOOTBALL") Then            web.Document.Forms(0).Item(8).selectedIndex = 1            web.Document.Forms(0).Item(8).Click        End If

for some reason now, after the wbP.Document.Forms(0).Item(8).Click it just goes back to the football option,

anyone have any ideas?

Drag And Drop: Ambiguous Click Bug
Option Explicit

' Thanks go to DougT for the drag and drop codehelp.

Private Sub Board_DragDrop(index As Integer, Source As Control, x As Single, Y As Single)
Static intOffBoard As Integer

If Board(index).Tag = vbNullString Then
Board(index).Picture = LoadPicture(Source.Tag)
Board(index).Tag = Source.Tag
If intOffBoard > 0 Then
Load OfftheBoard(intOffBoard)
OfftheBoard(intOffBoard).Top = OfftheBoard(intOffBoard - 1).Top + OfftheBoard(intOffBoard - 1).Height
OfftheBoard(intOffBoard).Left = OfftheBoard(intOffBoard - 1).Left
End If

OfftheBoard(intOffBoard).Picture = LoadPicture(Board(index).Tag)
OfftheBoard(intOffBoard).Tag = Board(index).Tag
intOffBoard = intOffBoard + 1

Board(index).Picture = LoadPicture(Source.Tag)
Board(index).Tag = Source.Tag
End If

Set Source.Picture = Nothing
Source.Tag = vbNullString
End Sub

Private Sub Board_MouseDown(index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)
If Board(index).Tag <> vbNullString Then
Board(index).DragIcon = Board(index).Picture
Board(index).Drag 1
End If
End Sub

Private Sub Board_MouseUp(index As Integer, Button As Integer, Shift As Integer, x As Single, Y As Single)
Board(index).Drag 0
End Sub

Private Sub Form_Load()
Dim intI As Integer
Dim intSquare(1 To 64) As Integer
Dim strfile As String

For intI = 1 To 64
intSquare(intI) = intI
Next intI

For intI = 1 To 16
strfile = App.Path & "pieces" & intI & ".ico"
Board(intSquare(intI)).Picture = LoadPicture(strfile)
Board(intSquare(intI)).Tag = strfile
Next intI

For intI = 17 To 32
strfile = App.Path & "pieces" & intI & ".ico"
Board(intSquare(intI + 32)).Picture = LoadPicture(strfile)
Board(intSquare(intI + 32)).Tag = strfile
Next intI
End Sub

This is my code (thanks again to DougT) for a chess board which allows the user to move any piece to any position. It works wonderfully except for one thing, when the user clicks on a piece ambiguously it starts the drag and drop and it thinks that that piece is being replaced with itself and so removes it to offtheboard. Is there anyway to stop this from happening? I have tried several ways to try and get this to do right but can't.

Please help.


Drag -n- Drop Through Button Click
Hi all,

I m trying to achieve drag n- drop thr. Button click(frankly i've not tried Drag n Drop earlier). Let me explain wht i want to do:--

I have a MflexGrid which has 4 Columns (First Three Visible, and 4th Hidden) and Three Command Buttons(Labeled 2, 3 & 1).

Now what i want is when I press Button labeles 2 Second Column of the Grid should be Shifted to First position. When user presses button labled 3 third column should be shifted to 1st position and so on...

ny idea......

Thanks in adv.

MDI Frm Menu, And Right Click Menu Problems
I have a MDI form with a Menu Bar, and a Right Click Menu that work fine without any Child forms. But once I load a child form on the MDI form, the Menu Bar is Empty(Just a gray line). And the Right Click Menu doesn't work anymore. Please help!!

Edited by - Krum on 9/4/2003 5:13:15 PM

VB Drop Down Menu
Is there any way to colorize the drop down menu?? the gray can be so boring.

Drop Down Menu
Hi Guys,

How can I assign a macro to individual data item within a drop down menu?

I have had a good search but can't find anything. Any ideas?

Cheers all


Drop Down Menu
Hi guys...need some advice here.

I am trying to creating a scroll down menu where the user can click on the arrow on the right side and a menu will appear and the user can click on any items on that menu.

Its just like the address bar on our internet explorers or netscape where U click on the arrow and the address of previous websites you keyed in will be appear in a drop down menu.

1. I dont have to enter any thing inside as the contents are defined beforehand.Like say the content inside the 'bar' is '1' with the arrow beside it.
2. If the user click on the arrow button (pointing down), a menu will pop down with options inside saying 2,3,4 or on.
3. If the user click on say, 5, then 5 will appear on the bar and the menu disappears.

I mean its just like how normal dropdown menus work.Hope I have explained my question clearly.

Do anyone have any idea?

Drop Down Menu
How do I make it so that when I click on a command button or something, that it brings up a drop down menu just under the command button.

Drop Down Menu
How do I make the drop down menu work so that if a user types the letter j the combo jumps down to all the j entries or if they type y it goes to the entries that begin with the letter y etc. etc. is there a combo box property that does this?


Drop Down Menu
hey, can someone tell me how to call a drop down menu, so when a button is clicked a menu come up below it.


Drop Down Menu
Hiya this is my first post so bear with me:
Cascally I'm tryin to assign a value to the global variable 'p' (integer) when something in a drop down box is changed and then write it to a file. the file part comes later now i need to know why this isn't assigning a value to 'p'.
basically when the form loads i have these ass my items:

Private Sub Form_Load()

wca.AddItem "No Victory Requirements"
wca.AddItem "Last Alive"
End Sub

Everything shows up dandy in the program. Now I have this when the data in the drop down menu is changed:

Private Sub wca_Change()

If wca.DataField = "No Victory Requirements" Then
p = "0"
End If
If wca.DataField = "Last Alive" Then
p = "2"
End If
End Sub

The wuotes on the numbers don't change anything. Now it's not giving me an error message,b ut whe I try to write the variable 'p' to a file I always get a 0 there no matter what. can you help? Thanks so much.


Drop Down Menu
In Internet Explorer on the Back button it has a little drop down menu. It shows the list of previous web sites you were on. Same with the forward button. How would you do that in VB?

Drop Down Menu
Hello ,
I have created a drop down menu & it has a list of numbers say from 1 to 10( generated from Ms Access DB)
& i have created a button. I want to select a number from drop down menu & display it on a label
But no matter what I select it gives me the same number that is 1.
 How can I see that I have selected the number 3.

 Private Sub infoButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles infoButton.Click

        myEmpId = EmpIdList.SelectedValue

        Label1.text = " Emp Id is :" & myEmpId

    End Sub
How can I see the selected value on
1. The same page
2.some other page

Drop Down Menu Help!!!
what is the code to get the drop down menu to work

Is It Possible To Undo A Drag Drop By Mouse Click

Looking for some help pls!

i have several Images on my form, some with pictures in them some
without pics. On all of the Images I have these property settings

DragMode 0-Manual
OLEDragMode 1-Automatic
OLEDropMode 2-Automatic

These setting allow me to move the pictures about the Image Controls freely with out having to put any code in to the actual Image Controls.

My problem is this, if I drag a picture to the wrong Image Control I have to manually move it back the same way as I dragged it there. Is it possible to undo this? As in if I move it to the wrong Image control I simply click on it with the mouse and the picture will automatically move back to its original Image Control

Thanks for your time!

Ugly Drop Down Menu
Does anyone know how I can make the drop-down menu less, well, ugly?

Mine is always a dark ugly brown. Any way to change this? I suppose you can purchase developer tools that spruce up the menus (as I have seen ads for stuff like this).


Drop Down Menu For Outlook

I was wondering if any of you experts out there can help me with this problem.

After I send an Email in Outlook, I would like Outlook 2000 to automatically save the Email in a specific folder (obtained say by the message subject).

How could I go about customising the Outlook send button, or make it run a script which would enable me to do this?


Extending The Drop Down Menu
Is it possible to increase the amount of text that can be placed into the drop down menu control in MS Word's Form Toolbar?

Drop-Down Menu To Textbox
I am trying to add text to a textbox from a drop-down menu using vbscript in an asp page. I know how to use the onclick option in visual basic to accomplish this, but how can I do it using active server pages?

Drop Down Menu Question
I have a folder at C:Sounds which has 5 sub-folders inside, each 1 has a persons name eg. Bill, Ted, Alice etc. (and these will probably get changed quite often.)

What I want to do is to check the names on these sub-folders and have them appear on a drop down menu.

Is it possible ?

Drop A Menu Programmatically
How can I simulate a mouse click on a menu (on the menu bar) under program control? I've looked through the help but I must be missing it somewhere.


Drop Down Menu In Grid?
Hello everyone,
I'm looking to create an alerts window. My plan originally was to use a datagrid to display the error with a recommended action. Problems arose when I realized I couldn't put a combobox on a datagrid, or any other type of grid for that matter. I am simply looking for a way to display multiple alerts in a streamlined fashion. Any ideas?

Icons In Drop Down Menu

How can i put icons in my drop down menu..??

E.g: save icon next to save option...

Hope my question is clear....!!!

Thanks in advance,

Auto Drop Down Menu
I need to know if it is possible to it in vb, as i move my mouse on the menu bar popup should pop up i.e the operation done on click should be done on my movement of mouse


Activex (drop-down Menu For Web Use)
hi people.i have been asked to produce a drop down menu with activex + javascript. have not axperience with vb . could someone give me some help? what steps should i follow?

Drop-down Menu-button?

I originally posted this in
but didn't get much of a response.

I can't seem to get this "menu-button"
control right in VS 2005. I don't know
if it exists as a .NET control or not.
Ideally I would like the button to be flat
until the mouse pointer is over it at which
point it pops up a bit to look like a normal
button. When I push the button it toggles down,
buttons below it are slid down a bit, and an
associated (context)menu drops down from
the pushed button (this menu is "attached"
to the bottom edge of the pushed/toggled
button). When you push the same button again
it toggles back up, the (context)menu "rolls
back up" into the button and the buttons below
it slide back up to where they first were.
It would be kind of like the Toolbox's
expanding buttons in VS 2005.

Thank for any help,


How To Put Icons On Drop Down Menu's
Hi guys! could somebody help me on how to put icons on drop down menu's


Edited by - and_sien on 6/15/2005 5:50:13 PM

Drop Down Menu - Icon
Hi there,
I want to add an icon/image against a menu item in the drop down menu list.Any suggestions. Thanks.

Combo Box - Drop Down By Code Without User Mouse Click
Dear all,
Sorry, I think this has been answered recently, but I can't find it!
I want a combo box to drop down automatically by code (straight after it has
been populated from a query).
Would anyone please help me with the code?

Thanks very much in advance,

John Powell

Changing Drop Down Menu Colour
Hi, i know this is probably going to be a pain in the arse but how do I add colour to the Drop Down Menu in vb6? I hate the white bg, ruins my design completely. Also is it possible to add an image there? Change thwe menu text colours, add little icons next to the text in the menus? Any help is grateful. cheers

Adding Picture To Menu Drop Down
Hello to all

I want to add pictures in the menu drop down. As you can watch the same when you drop down menu in the menubar of VB, Word menubar.

How to go for this .

Thank You

Icons To The Menu Drop Downs
I have heard about a third party program that allows you to add icons to the menu pull-down bars.
Does anyone know where I am able to obtain one?

MS WordXP Initiating Drop Down Of Menu
I used to use this in my code to drop down the file menu in Word 2000

'Open Word to populate the data
Set WordApp = New Word.Application

AppActivate "Microsoft Word"
SendKeys "%f"

It doesn't seem to work now with Word XP.

Is there something different to use?


URGENT HELP! Drop Down Menu Mailto
Iím trying to create drop down menu in an Excel based form that will email the results to a different address dependent on which drop-down option is selected. But - I donít want it to send the results until a separate submit button (at the end of the form) is clicked.

How can I do this?

Copyright © 2005-08, All rights reserved