Home Forums WinForms controls Xceed Grid for WinForms Button_Click problem

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #12713 |

    I need a Save button and a close button. Close should do the same thing as Save plus close the form.

    I tried this:

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

    ‘Save Button

    Try
    InsertionRow1.EndEdit()
    OleDbDataAdapter1.Update(MatterDataSet11)
    MatterDataSet11.AcceptChanges()
    ‘set focus on adjacent row
    GridControl1.DataRows.Item(1).Cells(0).EnterEdit()

    Catch ex As Exception
    MsgBox(ex, ToString)

    End Try

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

    Me.Button2_Click()

    Me.Close()

    End Sub

    The compiler says “Argument net specified for parameter ‘e’ of button_Click2”

    How can i call button 2 from button 4?

    Imported from legacy forums. Posted by Clay Rankin (had 2339 views)

    User (Old forums)
    Member
    Post count: 23064

    You have to pass 2 parameters to Button2_Click: the sender and the eventargs. Since you’re not doing anything with it, you can pass null for both parameters, but perhaps you can also pass the sender and eventargs that you’ve got in Button4_Click:

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click

    Me.Button2_Click(sender, e)
    Me.Close()

    End Sub

    Imported from legacy forums. Posted by Tommy (had 3417 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.