Windows Develop Bookmark and Share   
 index > Windows Forms Designer > add record question
 

add record question

probably a silly question but when you click on the + to add a new record on the navigator control bar, what is the underlying vb code for that operation TIA
ajking  Thursday, June 28, 2007 3:20 PM

Hi,

Here is some code to navigate to the next item in datatable,hope it helps.If you want more ,you can find in MSDN about bindingsource and position.

Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _

Handles button1.Click

' If you are not at the end of the list, move to the next item

' in the BindingSource.

If BindingSource1.Position + 1 < BindingSource1.Count Then

BindingSource1.MoveNext()

' Otherwise, move back to the first item.

Else

BindingSource1.MoveFirst()

End If

' Force the form to repaint.

Me.Invalidate()

Sub

Gavin Jin - MSFT  Friday, June 29, 2007 9:13 AM

Hi,

Here is some code to navigate to the next item in datatable,hope it helps.If you want more ,you can find in MSDN about bindingsource and position.

Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _

Handles button1.Click

' If you are not at the end of the list, move to the next item

' in the BindingSource.

If BindingSource1.Position + 1 < BindingSource1.Count Then

BindingSource1.MoveNext()

' Otherwise, move back to the first item.

Else

BindingSource1.MoveFirst()

End If

' Force the form to repaint.

Me.Invalidate()

Sub

Gavin Jin - MSFT  Friday, June 29, 2007 9:13 AM

You can use google to search for other answers

Custom Search

More Threads

• Design problem...
• Design Time Controls
• Custom Control
• Re ordering the columns in datagridview
• CollectionEditor re-creates removed items
• How to implement Datasource property on custom controls?
• How to resize Custom Panel Control inside Parent Panel to Prevent Horizontal Scrolling
• Adding image resource causes design view error
• PostFilterProperties on a Form ParentControlDesigner
• .NET 2.0 ListView ScrollBars Width and Visibility