Results 1 to 12 of 12

Thread: run file open command

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    49

    run file open command

    I am running an application from my desktop as you see on the picture,and I don't know how to run File Open command on active form without mouse click,only with vb.application?
    Attached Images Attached Images  

  2. #2
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: run file open command

    you need to add the shortcut to the menu object property

    here to help

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    49

    Re: run file open command

    That application has a shortcut for open and it is "Ctrl+O",but how to run with my vb.net application??

  4. #4
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: run file open command

    you just press ctrl+O when the form has focus!

    or are you talikg about writting the action openfile that happens once you click on the menu item?

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    49

    Re: run file open command

    When I hit ctrl+o its working and show me a dialog what to open,but how to do that using vb(do not hit manually by the keyboard)??

  6. #6
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: run file open command

    and when you click it it works too?

    is what you mean ...

    how do i cause this to happen when i am in the program and want the program to cause a file open event to happen?

  7. #7

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    49

    Re: run file open command

    I running one application in vb with:
    a = Process.Start("C:\Window1.exe")

    When it's stared show me a form as on the picture.
    How to hit Ctrl+o using vb2010?
    That's all.

    So,control one application with other one.
    Tnx

  8. #8
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: run file open command

    have alook for articles about sendkey in vb

    its an activity i try to avoid!

    here to help

  9. #9

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    49

    Re: run file open command

    Code:
    Public Class Form1
        'Button1=RUN button
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            System.Diagnostics.Process.Start("calc")
    
        End Sub
        'Button2=COPY Button
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            SendKeys.Send("^c")
        End Sub
    End Class
    If I success with this problem I will success with my application above,because it's similar problem.
    Any idea?

  10. #10
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: run file open command

    did you lookup how to send crtl+O using the send key method

  11. #11

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    49

    Re: run file open command

    I trying to sendkeys to another application using my button from my application.
    Other application must get focus.How to do that?




    CTRL+O or CTRL+C or CTRL+S= It does not matter
    Some of them must be.
    Last edited by blueye89; Feb 16th, 2012 at 06:07 PM.

  12. #12
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: run file open command

    the example form microsoft about the use of sendkey explains all of the process in some detail!

    go have a read


    here to help ( but really busy just now )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width