Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have been trying to debug my code to do two things and I need help with it while I am just starting out with vb.net

 

My code below is pretty straight forward, I would like to see by what means I could add code to see if an existing instance of the program I want to bring active exists. If it does exist then it would be activated with focus. If there isn't an instance of it open then a msgbox would pop up with a warning notice to open the needed program or file and retry again.

 

**Would AppActivate or something like

Shell ("notepad", vbNormalFocus) be better to use?

 

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 

AppActivate ("Document - Wordpad")

 

Dim blog = TextBox1.Text

 

SendKeys.Send(blog)

 

End Sub

 

Thanking the ones that reply in advance

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...