activate file save command [Copy data from another application]
I am running an application from my desktop as you see on the picture,and I don't know how to run File Save command on active form without mouse click,only with vb.application?
Last edited by Cimperiali; February 17th, 2012 at 06:38 AM.
Reason: Changing title accordingly to real quest
You have not given us much to go on. If you mean you want to fire the event from code then just click on it in the designer and look at the name of the sub routine being called there and then make a call to that sub routine from where ever. Or if you mean that you want to execute the event from the keyboard as you can see it is mapped to CTRL+O
If you are looking to display the open file dialog then you should look up the file open dialog in your online help.
If you are looking for code to actually open the file then the method you should use depends on what kind of file it is and what you are planning to do with it.
EXAMPLE:CTRL+O or CTRL+C or CTRL+S= It does not matter
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?
Last edited by Cimperiali; February 17th, 2012 at 06:33 AM.
Reason: Modified Code: to [code] tag
I still do not know what you are trying to do? Are you trying to sendkeys to another application or are you trying to pull up the open file in your application.
If you are trying to send keys to another application the first thing you need to do is make sure the other application has focus which it will not have in your example as your app must get focus in order for you to click the button which means you are sending keys to your own app.
What is it that you are actually trying to do?
In general Sendkeys is not a good approach to most things.
Why would you want to send a key to another app from a button? This makes no sense why not just hit the key in the app you want it to go to?
I am wondering why you are not telling us what app you are trying to send keys to or why, perhaps a questionable persuit? I will repeat the clue I gave before in that you must have focus on the application the key is to be sent to before you can sendkeys to it.
If you want more tell us what you are really trying to do and I know it is not calculator.
You are so curious :-).Suffice it to say that I wanna get some information from application which I am not autor.I will never make application like that,so I just wanna use as a gift.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.