469,167 Members | 2,044 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,167 developers. It's quick & easy.

Set control to a button in control the tool bar

274 100+
hi everyone,
I want to make a quick access to the first button in the tool bar.To start a transation on press Enter Key from the Enter pad. or you can assume that I want to set a default selection on one menu option.I can't program fro keypress or keydown evern for the mdiform.What I should do ?
thanks in advance
farhana
Sep 27 '07 #1
11 1306
creative1
274 100+
Hi Experts
Should I assume that this is something that we can't do??? My co-op employer wants me do that. He insists to start sales transection by pressing Enter from the keyboard. I am really screwed up with this. Can't find anything about it. Please help me resolve this problem.
regards
farhana
Sep 28 '07 #2
hariharanmca
1,977 1GB
Be clear with your problem. explain your problem in detail and version of front-end.
Sep 28 '07 #3
creative1
274 100+
I am a student developer.In fact I have desinged a PoP application using VB6. I created an interactive enviornment for quick access to all controls and menu options. This application will be used in a very fast paced syatem. Where people don't have time to use mouse to switch between menu control option and can't click on tool bar buttons too.
I am asked to design an appliation that will work on keystrokes. I have programmed Enterpad for company. this enterpad has many shortcut keys for quick access to products, menu options, and reprts. Such as when user hit Purchase button it displays Purchase Window and when user press Account Statement button from enter pad it will print a report.

Now the problem is , old syatem was developed in Foxpro, and Purchase process started on pressingEnter Key from enterpad. But I programmed a new key on Enterpad that will start Purchase module. But old users insist to use Enter key instead Purchase(that is Ctrl-Q shortcut key in the menu). for operator's convience I added a toolbar where I kept a few picture boxes with some shortcut keys entered with them so that user can remember these keys such as Ctrl-Q to start a transection, Ctrl-X to Exit etc.

Now I am lookin gfor ways how I can start purchase transection on Enter keys . I can logically think if I set focus on Purchase button in the tool bar. or you can say how I can set default focus on one control in menu to start it.

I hope now you understand what I want to do. Although small issue but .... I am not able to do that.
Is this somethng that we can do using Vb6?
regards
farhana
Sep 28 '07 #4
QVeen72
1,445 Expert 1GB
Hi,

Create Menus, and Assign Short-Cut Keys for those Menus.
Menu Short-Cut keys will work for MDI Form..
may be in the menu_Click event, u can call ToolBarClick event with
passing Appropriate button.

I think this is an easy way out..


REgards
Veena
Sep 28 '07 #5
hariharanmca
1,977 1GB
I am a student developer.In fact I have desinged a PoP application using VB6. I created .....................
I think the below code helps you if you are using vb 6

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  2.     Select Case KeyCode
  3.         Case vbKeyReturn:
  4.             Select Case KeyCode
  5.                 Case 1:
  6.                     'Key Shift+Enter : Your purchase order code here
  7.                 Case 2:
  8.                     'Key Ctrl+Enter : Your purchase order code here
  9.                 Case 3:
  10.                     'Key Ctrl+Shift+Enter : Your purchase order code here
  11.                 Case 4:
  12.                     'Key Alt+Enter : Your purchase order code here
  13.                 Case 5:
  14.                     'Key Alt+Shift+Enter : Your purchase order code here
  15.                 Case 6:
  16.                     'Key Alt+Ctrl+Enter : Your purchase order code here
  17.                 Case 7:
  18.                     'Key Ctrl+shift+Alt+Enter : Your purchase order code here
  19.             End Select
  20.     End Select
  21. End Sub
  22.  
  23. Private Sub Form_Load()
  24.     Me.KeyPreview = True
  25. End Sub
  26.  
Now the problem is , old syatem was developed in Foxpro, ..................
Should be sure keypad is VB or Foxpro

Now I am lookin gfor ways how I can start purchase .........
Do not call purchace order method by simply hit enter. (Because that is usualy presed by end user.

I hope now you understand what I want to do. ......
Till not clear just Guessing.
Sep 28 '07 #6
hariharanmca
1,977 1GB
Hi,
Create Menus, and Assign...........
But there is no short key for return!
Sep 28 '07 #7
QVeen72
1,445 Expert 1GB
Hi Hari,

He has his ToolBar on MDI Form.. and MDI is his main startup form,
Key Events does not work for MDI...


Regards
Veena
Sep 28 '07 #8
hariharanmca
1,977 1GB
Hi Hari,
He has his ToolBar on MDI Form..
Okay, i didn't read it properly (she should type MDI in caps)...
Sep 28 '07 #9
QVeen72
1,445 Expert 1GB
Hi Creative,

There is one more way,

Place a PictureBox on the MDI, Fill the MDI with whole of Picture Box, and Make TabIndex of PictureBox =0.
and write the Code what Hari Suggested for PictureBox1_KeyUp event..
It shud work OK..


Regards
Veena
Sep 28 '07 #10
creative1
274 100+
Thanks Veena n Hari
I'll try this out and tell what I will come out with. By the way I m SHE.
regards
Farhana
Sep 28 '07 #11
creative1
274 100+
Hi Veena and Hari
Finally I got what I wanted to do, with your help thanks here is what I did
1.. used a picture box maximized it...(I was going to used one theme picture as background picture.)
2.. then I set tab for picture to 0
3... called mnuPurchasefrmQuickCash_Click event

now I can startpurchase transection on Enter Key. Very easy but Mind-blowing you two
thanks
Farhana
Sep 28 '07 #12

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by John Smith | last post: by
5 posts views Thread by c676228 | last post: by
2 posts views Thread by Mark A. Sam | last post: by
3 posts views Thread by goot | last post: by
4 posts views Thread by Duncan Dimech | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.