08-03-13, 04:27 PM
انا عتدي فورم في 3 ازرار اريد عند اخر زر مضغوط علية وعملت end للبرنامج اول لما يفتح يلون اخر زر تم ضغطة اواخر حدث تم بالفورم وتغير لونة
ارجو التوضيح بمثال
ارجو التوضيح بمثال
MAZEN كتب :انا عتدي فورم في 3 ازرار اريد عند اخر زر مضغوط علية وعملت end للبرنامج اول لما يفتح يلون اخر زر تم ضغطة اواخر حدث تم بالفورم وتغير لونة
ارجو التوضيح بمثال
MAZEN كتب :انا عتدي فورم في 3 ازرار اريد عند اخر زر مضغوط علية وعملت end للبرنامج اول لما يفتح يلون اخر زر تم ضغطة اواخر حدث تم بالفورم وتغير لونة
ارجو التوضيح بمثال
Public Class Form1
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
Try
Me.Controls(GetSetting(Application.ProductName, "ActiveControl", "Name")).Focus()
Catch ex As Exception
End Try
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
SaveSetting(Application.ProductName, "ActiveControl", "Name", Me.ActiveControl.Name)
End Sub
End Class
@@أبورائد@@ كتب :السلام عليكم ورحمة الله وبركاته
تفضل طريقة أخرى
PHP كود :
Public Class Form1
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
Try
Me.Controls(GetSetting(Application.ProductName, "ActiveControl", "Name")).Focus()
Catch ex As Exception
End Try
End Sub
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
SaveSetting(Application.ProductName, "ActiveControl", "Name", Me.ActiveControl.Name)
End Sub
End Class
السلام عليكم ورحمة الله وبركاته

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