Adblock breaks this site

Need help with something

Discussion in 'Programming General' started by O Glitch O, Aug 23, 2008.

  1. O Glitch O

    O Glitch O Forum Addict

    Joined:
    Aug 14, 2008
    Posts:
    347
    Referrals:
    0
    Sythe Gold:
    0
    Need help with something

    I need help with a program to where i press a button and it types text.

    And help will be appreciated greatly :)
     
  2. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    Need help with something

    Have on your form a button named Command1 and a textbox named Text1.
    Code:
    Private Sub Command1_Click()
    Text1.Text = "" 'Set the textbox to empty
    Text1.SetFocus 'Give the textbox focus so we can type in it
    SendKeys "Hi" 'Type into the textbox
    End Sub
    
    There are a few other "better" ways of accomplishing this but they require complicated things such as APIs and Hwnds therefore I felt it best not to complicate things for you at the beginning. Hopefully you understand this and keep going further. :)
     
  3. O Glitch O

    O Glitch O Forum Addict

    Joined:
    Aug 14, 2008
    Posts:
    347
    Referrals:
    0
    Sythe Gold:
    0
    Need help with something

    Thanks!
     
< really old vb program i found on my hard drive | [C# Snippet] Trajectory example >


 
 
Adblock breaks this site