30-07-19, 12:34 PM
السلام عليكم
اولا
اذهب الي اعدادات المشروع
ثم الي خيار settings
ثم في حقل name اكتب nb
وفي حقل type قم باختيار integer
ثم قم باضافة class للمشروع وضع هذا الكود به
Namespace My
Partial Friend Class MyApplication
Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As
Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
My.Settings.nb += 1
My.Settings.Save()
End Sub
End Class
End Namespace
ثم في Form1 ضع textbox
ثم ضع هذا الكود
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.ReadOnly = True
TextBox1.Visible = False
TextBox1.Text = My.Settings.nb
If TextBox1.Text > 5 Then
MsgBox("تم انتهاء المدة التجريبية برجاء تفعيل البرنامج")
Me.Enabled = false
Form2.ShowDialog()
End If
End Sub
اولا
اذهب الي اعدادات المشروع
ثم الي خيار settings
ثم في حقل name اكتب nb
وفي حقل type قم باختيار integer
ثم قم باضافة class للمشروع وضع هذا الكود به
Namespace My
Partial Friend Class MyApplication
Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As
Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup
My.Settings.nb += 1
My.Settings.Save()
End Sub
End Class
End Namespace
ثم في Form1 ضع textbox
ثم ضع هذا الكود
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.ReadOnly = True
TextBox1.Visible = False
TextBox1.Text = My.Settings.nb
If TextBox1.Text > 5 Then
MsgBox("تم انتهاء المدة التجريبية برجاء تفعيل البرنامج")
Me.Enabled = false
Form2.ShowDialog()
End If
End Sub
![[صورة مرفقة: p_1583w56341.gif]](https://l.top4top.io/p_1583w56341.gif)
