Hi All
I have a menu bar in vb6 project. I want to set default control to the first option.
If the menu bar has following (File Edit Purchase Report...) I want to set default control on first option of File. So that user may press Alt button to do that.
Can someone help?
11 1532
What do you mean by set default control on first option
What exactly you are trying to do ?
Please pas on few more details .
Well I have a traditional menu with following options (Purchase, Reports, Maintenance.... ) with pullup menus. Like this Purchase Reports
CashQ Account Statement
Account Balance Sheet
I want to do something like this: when I open software and hit an Enter Key from the keyboard, it start CashQ which is first option in menu.
If user don't want to do Cash-Q he can use arrow keys to scroll between menu options. How I can do this?
I hope now you understand this.
try to call the click event of the first item of the file menu in the keydown event of the form.
try to call the click event of the first item of the file menu in the keydown event of the form.
Or perhaps you could use SendKeys to send Alt, then down arrow.
try to call the click event of the first item of the file menu in the keydown event of the form.
I don't think that will do the trick. I think the OP just wants to highlight the option, not activate it.
I just want to highlight the first option (or you can say I need to send ALT only)
In fact old system was DOS-based and my supervisor wants me to give it the same look and feel as old.
Please help me with code too... All that is happening on MDI form.
Thanks,
Farhana.
I just want to highlight the first option ...
Have you tried any of our suggestions?
As I told you I want to this on an MDIForm so I can't work on KeyDown event. I used a picture box on it and then setcontrol to its KeyDown event. I achieved one of the thing by hitting Enter Key on keydown event of picturebox. Now I want to pass ALT if anykey other than Enter is pressed.
I am trying this. - Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
-
If KeyAscii = 13 Then
-
Call mnuPurchasefrmQuickCash_Click
-
ElseIf KeyCode = vbKeyP Then
-
If Shift And vbAltMask Then
-
MsgBox "Alt-S was pressed!"
-
End If
-
End If
-
End Sub
In case you're interested, you can check for KeyCode = 18 to detect ALT pressed, though this is probably not what you want. Just use an Else to detect anything other than Enter.
Also, what's the problem with sending your ALT? Have you tried SendKeys?
By the way, the message you're displaying is misleading. It's activated by Alt-P and says Alt-S was pressed. :-)
I have been using following code: - Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
-
If KeyCode = 13 Then
-
Call mnuPurchasefrmQuickCash_Click
-
Else
-
SendKeys ("%{DOWN}")
-
End If
-
End Sub
It activates the menu but call in infinite. The control keeps on moving through the menu.......any idea?
If I use only sendkeys(% ) it does nothing simply no effect.
Well since you're sending a key (effectively telling Windows that the user pressed it) then I suppose it activates the KeyDown event. Just set a flag and don't do anything until control comes back. Or do nothing if the time is too short since the event was last activated. Use your imagination.
Also, you don't want to send the Alt-Down combination. You want to send Alt first, then Down. It's not the same. Check the SendKeys documentation, I think there's a way to send Alt.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Randi |
last post by:
Hi all,
I have this project to use the ADODB control to acces and manipulate the
Access DB. I amd the mistake of first doing this project with just the data
control. It worked fine with this...
|
by: Yves PEYSSON |
last post by:
Ji, my problem is simple. I would like to set dynamically the pressed item
of a menu of a form in javascript. First, how to get the value of the item
that has been selected with the mouse. Then how...
|
by: Pete |
last post by:
I have some funky form/event behavior.
Access 97. Split frontend/backend, using Access security. I have the
same behavior (or lack of behavior) for the pag_Click() event of two
separate pages...
|
by: bardo |
last post by:
I am running into the following problem would like to know if this a bug or me doing something wrong.
Using C# with visual studios 2003. I make a form and add a mainMenu Control.
Now I type in...
|
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...
|
by: WebDunce |
last post by:
hey all,
i'm building a custom control. it contains a treeview and a context menu. each tree node's context menu property is set to the control's context menu.
it works good...except...
if...
|
by: john_mcmahon |
last post by:
I'm having issues populating a second drop down menu that's dependent
upon a selection in the first menu. When I select an option from the
first menu, the second menu remains disabled, i.e. unable...
|
by: veteranwebdesign |
last post by:
Hello,
I have a main form. I want forms to open in a subform control box.
What is the code for the option group to open the subforms in the
control box.
I didn't create subforms, I created...
|
by: =?Utf-8?B?VG9tIFc=?= |
last post by:
When I mouse over a Menu Control based navigation area the drop-down
selection list appears instantaneously. Is there a way to make it less
sensitive, so that it delays (even a fraction of a second...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |