Important Announcement
PubHTML5 Scheduled Server Maintenance on (GMT) Sunday, June 26th, 2:00 am - 8:00 am.
PubHTML5 site will be inoperative during the times indicated!

Home Explore اختبار عملي ب vb

اختبار عملي ب vb

Published by megadrm, 2022-08-15 06:41:55

Description: اختبار عملي ب vb

Search

Read the Text Version

‫موعدنا اليوم مع طريقة تصميم اختبار عملي تفاعلي ﻷي برنامج يقوم طﻼبنا بدراسته من خﻼل الفيجوال بيزك‬ ‫تقوم الفكرة على استخدام أكثر من نموذج داجل المشروع والصور الشفافة وكذلك استخدام المديول ﻹنشاء متغير عام‬ ‫طريقة عمل المشروع‬ ‫انشاء المشروع‬



GrowAnd Srink ‫خصائص عامة للفورم‬ true autosize ‫جعل الخاصية‬ auto size mode ‫جعل الخاصية‬ Module Module1 Public fq1 As Integer = 0

Public fq2 As Integer = 0 Public result As Integer = 0 Public sname As String Public sclass As String Public spassword As String End Module ‫النموذج اﻷول‬ ‫التصميم‬ ‫الكود‬ Public Class Form1 Function getdata(ByVal filepath As String, ByVal sql As String) As DataTable Dim myconnection As New OleDb.OleDbConnection Dim mycommand As New OleDb.OleDbCommand Dim da As New OleDb.OleDbDataAdapter Dim dt As New DataTable ' myconnection.ConnectionString = \"provider=microsoft.jet.OLEDb.4.0;\" & \"data source=\" & filepath & \";\" & \"extended properties= excel 8.0\" myconnection.ConnectionString = \"Provider=Microsoft.ACE.OLEDB.12.0;\" & \"Data Source=\" & filepath & \";\" & \"Extended Properties=\"\"Excel 12.0;HDR=Yes\"\";\" mycommand.Connection = myconnection mycommand.CommandText = sql da.SelectCommand = mycommand da.Fill(dt) Return dt End Function

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim dt As New DataTable sname = Me.TextBox1.Text sclass = Me.TextBox2.Text spassword = Me.TextBox3.Text If Me.TextBox1.Text <> \"\" And Me.TextBox2.Text <> \"\" And Me.TextBox3.Text <> \"\" Then dt = getdata(\"student.xls\", \"select * from [data$] where password='\" & Me.TextBox3.Text & \"' AND name='\" & Me.TextBox1.Text & \"' \") If dt.Rows.Count = 1 Then Me.Hide() Formq1.Show() Else MsgBox(\"‫ & \" \" & \"صحيح ﺑﺸﻜل البيانات ادخل‬Me.TextBox3.Text & \" \" & dt.Rows.Count) End If End If End Sub Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click End End Sub End Class ‫النموذج السؤال اﻷول‬ ‫التصميم‬ ‫الكود‬

Public Class Formq1 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Me.PictureBox2.Visible = True Me.Button3.Visible = True Me.Button1.Enabled = True End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click fq1 = fq1 + 2 Me.Button3.Enabled = False End Sub Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click Me.Button1.Enabled = True End Sub Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click Me.Button1.Enabled = True End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Me.Hide() Formq2.Show() End Sub End Class ‫النموذج السؤال الثاني‬ ‫التصميم‬

‫الكود‬ Public Class Formq2 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Me.PictureBox2.Visible = True Me.Button3.Visible = True Me.Button1.Enabled = True End Sub Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click fq2 = fq2 + 2 Me.Button3.Enabled = False End Sub Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click Me.Button1.Enabled = True End Sub Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click Me.Button1.Enabled = True End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Me.Hide() resulte.Show() End Sub End Class

‫نموذج النتيجة‬ ‫التصميم‬ ‫الكود‬ Public Class resulte Private Sub resulte_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.Label3.Text = sname Me.Label5.Text = sclass result = fq1 + fq2 Label7.Text = result End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click End End Sub End Class


Like this book? You can publish your book online for free in a few minutes!
Create your own flipbook