tags:

views:

25

answers:

3

IS there any method to perform two different tasks in one click event

Like

By clicking OK button i can do

1- Instantiate a new form

2- Add somthing to listview or can do something else

But these tasks not to me simultaneous. One task at a time

Please if any one can help then i shall be thankful to him\her

A: 

In the button_Click event type in two methods?

void Button.._Click { Lstviewtest.Items.Add(--someting); Form m = new form(); m.Show(); }

is this what your looking for? If not what's your question exactly?

Emerion
Thanks for quick response,
Buzdar
Actually these taks will be performed simultanously, but i want one task to be performed at a time, not both
Buzdar
No problem ;), problem solved?
Emerion
one at a time, so u want to click once then show the form, then click again and add something to a listview?
Emerion
A: 

Thanks for quick response Actually these taks will be performed simultanously, but i want one task to be performed at a time, not both

Buzdar
A: 

Thanks Now i solved this in this way

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    If Form1.TabControl3.SelectedTab.Text = "Scope" Then
        If Me.TextBox3.Text <> "" Then
            Form1.ListView4.Items.Add(TextBox3.Text)
        End If
    Else
        If Form1.TabControl3.SelectedTab.Text = "Delegation" Then
            Dim f4 As New Form4
            f4.Show()
        End If

    End If

End Sub

Buzdar