1

我是 Visual Basic 的新手,正在尝试为一家家具公司制作数据库应用程序。我想添加一条具有默认值的记录,但我无法为新项目按钮运行我的代码。它的行为就像我没有输入任何代码一样。我正在使用 Visual Studio 2012。

Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles BindingNavigatorAddNewItem.Click

    GondereninAdiSoyadiTextBox.Text = "Some text"
    GondereninAdresiTextBox.Text = "Some text"
    GondereninVergiNoTextBox.Text = "Some text"
    Label1.Visible = False

    Me.Refresh()

End Sub

如何为 BindingNavigatorAddNewItem 添加代码?

4

1 回答 1

0

无论如何,我用这段代码创建了另一个按钮:

Private Sub ToolStripButton2_Click(sender As Object, e As EventArgs) Handles ToolStripButton2.Click

    MakbuzTBindingSource.AddNew()

    GondereninAdiSoyadiTextBox.Text = "Some text"
    GondereninAdresiTextBox.Text = "Some text"
    GondereninVergiNoTextBox.Text = "Some text"
    Label1.Visible = False

    MakbuzTBindingSource.EndEdit()

End Sub

http://www.vbforums.com/showthread.php?408692-RESOLVED-Add-Item-binding-source

于 2013-10-04T17:02:17.237 回答