10-03-13, 05:11 AM
السلام عليكم ورحمة الله وبركاته
تفضل
السلام عليكم ورحمة الله وبركاته
تفضل
PHP كود :
Public Class Form1
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
On Error Resume Next
' ActiveControl
Me.Controls(GetSetting(Application.ProductName, "ActiveControl", "Name")).Focus()
' DataGridView1.SelectedCells
Me.DataGridView1.ClearSelection()
Dim r As Integer = CInt(GetSetting(Application.ProductName, Me.DataGridView1.Name, "Row"))
Dim c As Integer = CInt(GetSetting(Application.ProductName, Me.DataGridView1.Name, "Column"))
Me.DataGridView1.Rows(r).Cells(c).Selected = True
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
On Error Resume Next
' ActiveControl
SaveSetting(Application.ProductName, "ActiveControl", "Name", Me.ActiveControl.Name)
' DataGridView1.SelectedCells
SaveSetting(Application.ProductName, Me.DataGridView1.Name, "Row", Me.DataGridView1.SelectedCells(0).RowIndex)
SaveSetting(Application.ProductName, Me.DataGridView1.Name, "Column", Me.DataGridView1.SelectedCells(0).ColumnIndex)
End Sub
End Class
السلام عليكم ورحمة الله وبركاته
