Radith,
In addition to the other's comments, you can also use Button.PerformClick.
> Private Sub cmdO_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles cmdO.Click
cmdCalculate.PerformClick()
> End Sub
This way if you have multiple handlers for a given button, then all the
handlers will be invoked.
Although I prefer to use Armin's first example. I normally have a single
handler both handle the same event.
Remember VB.NET event model is not your VB6 event model! You can have
multiple handlers for a given event, plus a given event handler can handle
events from multiple objects.
Notice in the following "Button_Click" handles the click event for all three
buttons, while each button also has their own specific handler. This would
be handy if you have some common logic that needed to occur for every click,
plus some specific logic for every click. Or the buttons occur in the base
form and the base form wants to handle the events, plus the derived form
wants to handle the events...
Private WithEvents Button1 As Button
Private WithEvents Button2 As Button
Private WithEvents Button3 As Button
> Private Sub Button_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click
> End Sub
> Private Sub Button1_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> End Sub
> Private Sub Button2_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button2.Click
> End Sub
> Private Sub Button3_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Button3.Click
> End Sub
Hope this helps
Jay
"Radith Silva" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Private Sub cmdCalculate_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles cmdCalculate.Click
> If txtName.Text <> "" Then
> If txtUnits.Text <> "" Then
> If optOne.Checked Or optTwo.Checked Or optThree.Checked
> Or optFour.Checked Then
> 'Data fine
> Else
> MessageBox.Show("Please choos an option button")
> End If
> Else
> MessageBox.Show("txtUnits")
> txtUnits.Focus()
> End If
> Else
> MessageBox.Show("txtName")
> txtName.Focus()
> End If
> End Sub
>
> Private Sub cmdO_Click(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles cmdO.Click
> Call cmdCalculate_Click()
> End Sub
>
> I have the two functions as stated above; now the call statement returns
> the error:
> C:\vbNet\beginning\nested_if\Form1.vb(141): Argument not specified for
> parameter 'e' of 'Private Sub cmdCalculate_Click(sender As Object, e As
> System.EventArgs)'.
>
> PLS HELP
>
> THANX
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!