4 Replies - 1409 Views - Last Post: 18 June 2009 - 01:38 AM Rate Topic: -----

#1 Robban98422   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 09

How to code that a button presses it self ?

Post icon  Posted 16 June 2009 - 11:59 AM

Hello there. i am a beginner as may know i have asked som question before. And now i stuck agien.

I want to do a "code" that presses a button by ut self with help of a timer. is that possible ?

Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
		SendKeys.Send(TextBox4.Text)
		Timer4.Stop()
		button1.click  <---- ? how
	End Sub
End Class 


i have a button called button1.

so any ideas :) ?

Is This A Good Question/Topic? 0
  • +

Replies To: How to code that a button presses it self ?

#2 Cookiesliyr   User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 136
  • Joined: 16-May 09

Re: How to code that a button presses it self ?

Posted 16 June 2009 - 12:07 PM

use this to call an event , make sure the parameters r right if u will call difference event

call Button1_click(sender,e)



sometimes it is better to make a function and let differant subs use it , like

private function MyFunction (whatever u want to send) 'as value (like integer) if u wanna return a value
' what do u want the function do 

end function

'inside ur timer and button1
Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
.....
MyFunction()
end sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.click
.....
MyFunction()
end sub



ofcourse my example shows u how its work but won't work if u copy and paste it :D good luck
Was This Post Helpful? 0
  • +
  • -

#3 Robban98422   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 12-June 09

Re: How to code that a button presses it self ?

Posted 16 June 2009 - 12:19 PM

Ah thanks it worked.

but the other alternative. is a little bit to advance for me right now. i dont know how to do a function. Byt there is maby some tutorials for that to :)

Thanks anyway
Was This Post Helpful? 0
  • +
  • -

#4 Cookiesliyr   User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 136
  • Joined: 16-May 09

Re: How to code that a button presses it self ?

Posted 16 June 2009 - 12:41 PM

try to see it how , i was use call allot till i know how to use function, it make ur code much easier to understand, and don't worry if u can write a code like that u can get function easily i am sure u can find tutorials about them

good luck
Was This Post Helpful? 0
  • +
  • -

#5 Tomek   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-June 09

Re: How to code that a button presses it self ?

Posted 18 June 2009 - 01:38 AM

Try this :

 button1.performclick

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1