Syntax

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

What is the correct syntax for calling Command1 index 2 from another sub.

I.E

Private Sub Timer1_Tick(yatta yatta)
If(Some condition) Then Command1(2)
End Sub

Thanks,
Michael
 
Thanks for the reply.
VB.Net
I figured it out.
This is how it looks..

Command1_Click(Command1.Item(1), New System.EventArgs())

Thanks,
Michael
 
Michael said:
Thanks for the reply.
VB.Net

An upgraded project from VB6?
I figured it out.
This is how it looks..

Command1_Click(Command1.Item(1), New System.EventArgs())

I suggest not to call the procedure because command1 has not been clicked.
If you want to execute the same code that is executed whenever Command1(1)
is clicked you should call the same procedure that is called in the Button's
click event. Means: Take the code out of the click event, put it in a
separate procedure and call it from the click event as well as from the
timer's tick event.
 
Armin Zingler said:
An upgraded project from VB6?
Yes.


I suggest not to call the procedure because command1 has not been clicked.
If you want to execute the same code that is executed whenever Command1(1)
is clicked you should call the same procedure that is called in the Button's
click event. Means: Take the code out of the click event, put it in a
separate procedure and call it from the click event as well as from the
timer's tick event.

Right. I agree. It was just a last minute additon to an existing program.
Thanks,
Michael
 
Back
Top