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

part2: Visual Basic controls

الكلية كلية هندسة المواد     القسم قسم هندسة المعادن     المرحلة 2
أستاذ المادة رفاه ابراهيم جبار       10/03/2019 14:38:07
Visual Basic controls


? Multiline: It specifies whether text displays in single line (False) or in multiple line (True).
Setting: It can be changed from properties window only.

? Maxlength: It limits the length of displayed text. Value (0) indicates to unlimited length.
Setting: It can be changed from properties window or from the program code using the statement:
Text1.Maxlength= value


? Alignment: It determines whether the text on textbox is left justified, centered, or right justified.
Setting: It can be changed from properties window or from the program code using the statements:
Text1.Alignment = 0 (left justified)
Text1.Alignment = 1 (right justified)
Text1.Alignment = 2 (centered)

? Locked : It determines whether the textbox contents can be changed (False) or not (True).
Setting: It can be changed from properties window or from the program code using the statements:

Text1.locked = False
Text1.locked = True

? Enabled : It determines whether the textbox respond to any event (True) or not (False).
Setting: It can be changed from properties window or from the program code using the statements:

Text1.Enabled = False
Text1.Enabled = True


Note: The setting of Backcolor, Forecolor, Font, Width, Height, Top, Left and Appearance properties is similar to Command Button setting for the same properties.

Example1: Design a Visual Basic project contains a single Form and one textbox. After running the program and when we write inside the Textbox, ( Collage of Material Engineering) text will be displayed in the center of Textbox with Red color and 20 Font size and in multiple line.

















? Textbox and Clipboard: The Clipboard is the area in the computer where all things get stored into when a user perform a copy , cut and paste operations. In Visual Basic, it is easy to get text stored in Clipboard and paste it into a textbox or a string variable. The following codes are used to store text in Clipboard and get the text from the clipboard then insert it into a textbox.


Code Operation
Clipboard.clear
Clipboard.SetText(Text1.Text) Copy
Clipboard.clear
Clipboard.SetText(Text1.Text)
Text1.Text="" Cut
Text2.Text=Clipboard.GetText Paste




Example2: Design a Visual Basic project contains a single Form, two Textbox and three commands. The properties of objects are listed in the Table below:

Object Properties
Command1 Name: cmdcopy
Caption : Copy
Command2 Name: cmdcut
Caption : Cut
Command3 Name: cmdpast
Caption : Past
Text1 Text: Visual Basic Lab
FontSize:10
Multiline: True


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