انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Non-Conditional Repeating

الكلية كلية هندسة المواد     القسم قسم هندسة السيراميك ومواد البناء     المرحلة 2
أستاذ المادة رلا سامي خضير عباس العيسى       16/12/2016 23:18:29
Non-Conditional Repeating
For … Next loop:
The For - Next loop is also known as a counting loop. It is an ideal loop structure when the number of iterations is known. It always contains a loop variable that works like a counter. The loop will run continually until the condition is false or till the condition is true.
Dim i As Integer
For i = 1 To 10
code
Next i
This code will loop 10 times.
Example1: Design a List Box includes an interval of years from 1960 to 2013
using For – Next loop.
Solution: Code:
Dim a As Integer
Form1:
Private Sub Form_Load()
For a = 1960 To 2013
List1.AddItem (a)
Next
End Sub
2
Visual Basic 6 lecture البرمجة بلغة فيجول بيسك 6 : المحاضرة الثامنة 8
Example2: Design a Combo Box includes an interval of years from 1960 to
2013 using For – Next loop.
Solution: Code:
Dim a As Integer
Form1:
Private Sub Form_Load()
For a = 1960 To 2013
Combo1.AddItem (a) Next
End Sub
Example3: write a program to print (welcome) ten times. Then make the color
changed and the size bigger at each time.
Solution:
Code:
Dim i As Integer
Private Sub Command1_Click()
For i = 1 To 10

المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .