Set control to a button in control the tool bar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • creative1
    Contributor
    • Sep 2007
    • 274

    Set control to a button in control the tool bar

    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
  • creative1
    Contributor
    • Sep 2007
    • 274

    #2
    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

    Comment

    • hariharanmca
      Top Contributor
      • Dec 2006
      • 1977

      #3
      Be clear with your problem. explain your problem in detail and version of front-end.

      Comment

      • creative1
        Contributor
        • Sep 2007
        • 274

        #4
        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

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          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

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by creative1
            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

            [code=vb]
            Private Sub Form_KeyDown(Ke yCode As Integer, Shift As Integer)
            Select Case KeyCode
            Case vbKeyReturn:
            Select Case KeyCode
            Case 1:
            'Key Shift+Enter : Your purchase order code here
            Case 2:
            'Key Ctrl+Enter : Your purchase order code here
            Case 3:
            'Key Ctrl+Shift+Ente r : Your purchase order code here
            Case 4:
            'Key Alt+Enter : Your purchase order code here
            Case 5:
            'Key Alt+Shift+Enter : Your purchase order code here
            Case 6:
            'Key Alt+Ctrl+Enter : Your purchase order code here
            Case 7:
            'Key Ctrl+shift+Alt+ Enter : Your purchase order code here
            End Select
            End Select
            End Sub

            Private Sub Form_Load()
            Me.KeyPreview = True
            End Sub
            [/code]

            Originally posted by creative1
            Now the problem is , old syatem was developed in Foxpro, ............... ...
            Should be sure keypad is VB or Foxpro

            Originally posted by creative1
            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.

            Originally posted by creative1
            I hope now you understand what I want to do. ......
            Till not clear just Guessing.

            Comment

            • hariharanmca
              Top Contributor
              • Dec 2006
              • 1977

              #7
              Originally posted by QVeen72
              Hi,
              Create Menus, and Assign......... ..
              But there is no short key for return!

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                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

                Comment

                • hariharanmca
                  Top Contributor
                  • Dec 2006
                  • 1977

                  #9
                  Originally posted by QVeen72
                  Hi Hari,
                  He has his ToolBar on MDI Form..
                  Okay, i didn't read it properly (she should type MDI in caps)...

                  Comment

                  • QVeen72
                    Recognized Expert Top Contributor
                    • Oct 2006
                    • 1445

                    #10
                    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_Key Up event..
                    It shud work OK..


                    Regards
                    Veena

                    Comment

                    • creative1
                      Contributor
                      • Sep 2007
                      • 274

                      #11
                      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

                      Comment

                      • creative1
                        Contributor
                        • Sep 2007
                        • 274

                        #12
                        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 mnuPurchasefrmQ uickCash_Click event

                        now I can startpurchase transection on Enter Key. Very easy but Mind-blowing you two
                        thanks
                        Farhana

                        Comment

                        Working...