Podcast
Questions and Answers
أي من الخيارات التالية يمثل بشكل أفضل الغرض الرئيسي من التفاعل مع المستخدم في برمجة #C؟
أي من الخيارات التالية يمثل بشكل أفضل الغرض الرئيسي من التفاعل مع المستخدم في برمجة #C؟
- عرض رسائل ثابتة للمستخدم دون السماح بأي إدخال أو تعديل.
- السماح للمستخدم بإدخال البيانات والتأثير على العمليات داخل التطبيق. (correct)
- تقييد وصول المستخدم إلى وظائف معينة في التطبيق.
- تحسين أمان التطبيق عن طريق منع المستخدم من رؤية التعليمات البرمجية.
ما هي الخاصية في عنصر مربع النص (Textbox) التي تحدد ما إذا كان مربع النص سيقبل سطراً واحداً فقط من النص أم عدة أسطر؟
ما هي الخاصية في عنصر مربع النص (Textbox) التي تحدد ما إذا كان مربع النص سيقبل سطراً واحداً فقط من النص أم عدة أسطر؟
- Scrollbars
- MaxLength
- PasswordChar
- MultiLine (correct)
في برمجة #C، ما هو الغرض الأساسي من 'Method'؟
في برمجة #C، ما هو الغرض الأساسي من 'Method'؟
- تنفيذ إجراء أو مهمة محددة على كائن. (correct)
- تحديد مظهر وأسلوب عنصر واجهة المستخدم.
- تحديد مجموعة من الخصائص.
- تخزين البيانات المتعلقة بالكائن.
أي من الخصائص الآتية لمربع النص (Textbox) تُستخدم لإخفاء النص المدخل، وعرض رموزاً بدلاً منه (مثل النجوم)؟
أي من الخصائص الآتية لمربع النص (Textbox) تُستخدم لإخفاء النص المدخل، وعرض رموزاً بدلاً منه (مثل النجوم)؟
ما هو الأمر الذي يجب استخدامه لإنهاء تطبيق #C بالكامل؟
ما هو الأمر الذي يجب استخدامه لإنهاء تطبيق #C بالكامل؟
أي جزء من مربع الرسالة (MessageBox) يسمح لك بتعيين النص الذي يظهر في أعلى النافذة؟
أي جزء من مربع الرسالة (MessageBox) يسمح لك بتعيين النص الذي يظهر في أعلى النافذة؟
عند استخدام MessageBox.Show في #C، أي جزء من الأمر يحدد الأزرار التي ستظهر في مربع الرسالة؟
عند استخدام MessageBox.Show في #C، أي جزء من الأمر يحدد الأزرار التي ستظهر في مربع الرسالة؟
أي جزء من الأمر ()MessageBox.Show يسمح لك بتعيين أيقونة معينة لتظهر على مربع الرسالة?
أي جزء من الأمر ()MessageBox.Show يسمح لك بتعيين أيقونة معينة لتظهر على مربع الرسالة?
باستخدام خاصية Scrollbars في #C، ما هي القيمة التي يجب عليك تعيينها إذا كنت تريد أن يكون لديك أشرطة تمرير أفقية ورأسية؟
باستخدام خاصية Scrollbars في #C، ما هي القيمة التي يجب عليك تعيينها إذا كنت تريد أن يكون لديك أشرطة تمرير أفقية ورأسية؟
في مربع نص #C، ما هي الخاصية التي تحدد الحد الأقصى لعدد الأحرف التي يمكن للمستخدم إدخالها؟
في مربع نص #C، ما هي الخاصية التي تحدد الحد الأقصى لعدد الأحرف التي يمكن للمستخدم إدخالها؟
أي خاصية تُستخدم للحصول على النص الذي تم تحديده حالياً في مربع نص؟
أي خاصية تُستخدم للحصول على النص الذي تم تحديده حالياً في مربع نص؟
عندما تريد تغيير اتجاه النص في مربع نص من اليسار إلى اليمين، أي خاصية يجب عليك تعديلها؟
عندما تريد تغيير اتجاه النص في مربع نص من اليسار إلى اليمين، أي خاصية يجب عليك تعديلها؟
أي خاصية يجب استخدامها لتغيير حالة الأحرف في عنصر مربع النص؟
أي خاصية يجب استخدامها لتغيير حالة الأحرف في عنصر مربع النص؟
أي من الإجراءات التالية تمسح كل النص الموجود في مربع نص؟
أي من الإجراءات التالية تمسح كل النص الموجود في مربع نص؟
أي من الإجراءات التالية يجب استخدامه لتحديد كل النص الموجود في مربع نص؟
أي من الإجراءات التالية يجب استخدامه لتحديد كل النص الموجود في مربع نص؟
ماذا يفعل الإجراء AppendText؟
ماذا يفعل الإجراء AppendText؟
أي من الإجراءات التالية يضع نسخة من النص المحدد في مربع النص في الحافظة؟
أي من الإجراءات التالية يضع نسخة من النص المحدد في مربع النص في الحافظة؟
ماذا يفعل الإجراء Hide()؟
ماذا يفعل الإجراء Hide()؟
الإجراء Show() يعرض كائناً تم إخفاؤه مسبقاً، ولكن كيف يتم إظهار مربع نص يسمى 'textBox1'؟
الإجراء Show() يعرض كائناً تم إخفاؤه مسبقاً، ولكن كيف يتم إظهار مربع نص يسمى 'textBox1'؟
عند إضافة وظيفة إلى زر لحساب مجموع قيمتين، أين يجب أن يوضع هذا الكود؟
عند إضافة وظيفة إلى زر لحساب مجموع قيمتين، أين يجب أن يوضع هذا الكود؟
الرمز (.) يستخدم للوصول إلى الخصائص والإجراءات، ولكن ماذا يمثل الرمز الموجود على يسار أسماء الكائنات في نافذة الكود؟
الرمز (.) يستخدم للوصول إلى الخصائص والإجراءات، ولكن ماذا يمثل الرمز الموجود على يسار أسماء الكائنات في نافذة الكود؟
عند إضافة الإجراء Text.ToUpper() إلى مربع النص، فما هو الغرض من إضافة الخاصية Text؟
عند إضافة الإجراء Text.ToUpper() إلى مربع النص، فما هو الغرض من إضافة الخاصية Text؟
إذا كنت تريد أن يكون برنامج #C قادراً على تنفيذ الإجراءات المناسبة بناءً على الأزرار التي ينقر عليها المستخدم في مربع الرسالة، فماذا تحتاج إلى كتابة؟
إذا كنت تريد أن يكون برنامج #C قادراً على تنفيذ الإجراءات المناسبة بناءً على الأزرار التي ينقر عليها المستخدم في مربع الرسالة، فماذا تحتاج إلى كتابة؟
أي من الخصائص التالية تعرض محتوى الرسالة في مربع الرسالة؟
أي من الخصائص التالية تعرض محتوى الرسالة في مربع الرسالة؟
ما هي الطريقة لتضمين الأزرار Yes و No و Cancel في مربع رسالة؟
ما هي الطريقة لتضمين الأزرار Yes و No و Cancel في مربع رسالة؟
إذا كنت تريد أن يظهر مربع الرسالة رمز الاستفهام، فأي رمز يجب استخدامه?
إذا كنت تريد أن يظهر مربع الرسالة رمز الاستفهام، فأي رمز يجب استخدامه?
ما هو الغرض من خاصية RightToLeft في مربع النص?
ما هو الغرض من خاصية RightToLeft في مربع النص?
في Squarespace، كيف يمكن إضافة نموذج اتصال إلى موقعك؟
في Squarespace، كيف يمكن إضافة نموذج اتصال إلى موقعك؟
لتطوير برنامج يحتوي على مربعين نص، كيف يتم نسخ المحتوى من المربع الأول للصق في المربع الثاني عند الضغط على زر؟
لتطوير برنامج يحتوي على مربعين نص، كيف يتم نسخ المحتوى من المربع الأول للصق في المربع الثاني عند الضغط على زر؟
إذا كنت ترغب في مطالبة تطبيق #C بإنهاء عملية معينة، فما هو الاستخدام المحدد للأزرار الثلاثة: Abort و Retry و Ignore؟
إذا كنت ترغب في مطالبة تطبيق #C بإنهاء عملية معينة، فما هو الاستخدام المحدد للأزرار الثلاثة: Abort و Retry و Ignore؟
ما هو الأمر الذي يجب أن تكتبه لكي يظهر مربع رسالة يحوي عنواناً ونصّاً مختلفين؟
ما هو الأمر الذي يجب أن تكتبه لكي يظهر مربع رسالة يحوي عنواناً ونصّاً مختلفين؟
أي من الخيارات الآتية هو الكود الصحيح لجعل النص المدخل في TextBox1 يظهر بأحرف صغيرة؟
أي من الخيارات الآتية هو الكود الصحيح لجعل النص المدخل في TextBox1 يظهر بأحرف صغيرة؟
تقوم الخاصية ()SelectedText بإرجاع النص الذي تم تحديده في مربع النص. إذا لم يتم تحديد أي نص فماذا ترجع هذه الخاصية؟
تقوم الخاصية ()SelectedText بإرجاع النص الذي تم تحديده في مربع النص. إذا لم يتم تحديد أي نص فماذا ترجع هذه الخاصية؟
ما النتيجة التي ستحصل عليها إذا كانت الكلمة المفتاحية 'This' موجودة في الكود؟
ما النتيجة التي ستحصل عليها إذا كانت الكلمة المفتاحية 'This' موجودة في الكود؟
في مربع الرسالة، ماذا يجب عليك فعله لعرض أزرار مثل نعم، ولا، وإلغاء الأمر؟
في مربع الرسالة، ماذا يجب عليك فعله لعرض أزرار مثل نعم، ولا، وإلغاء الأمر؟
اختر الأمر الصحيح للخروج من البرنامج?
اختر الأمر الصحيح للخروج من البرنامج?
ماذا تعني خاصية RightToLeft؟
ماذا تعني خاصية RightToLeft؟
Flashcards
التفاعل مع المستخدم
التفاعل مع المستخدم
يتيح للمستخدم إدخال البيانات أو إظهار الرسائل.
أداة الكتابة (Textbox)
أداة الكتابة (Textbox)
يستخدم لإدخال أو عرض البيانات للمستخدم.
الخاصية RightToLeft
الخاصية RightToLeft
تحديد اتجاه الكتابة من اليمين أو اليسار.
الخاصية CharacterCasing
الخاصية CharacterCasing
Signup and view all the flashcards
الخاصية Font
الخاصية Font
Signup and view all the flashcards
الخاصية MaxLength
الخاصية MaxLength
Signup and view all the flashcards
الخاصية MultiLine
الخاصية MultiLine
Signup and view all the flashcards
الخاصية PasswordChar
الخاصية PasswordChar
Signup and view all the flashcards
الخاصية ReadOnly
الخاصية ReadOnly
Signup and view all the flashcards
الخاصية Scrollbars
الخاصية Scrollbars
Signup and view all the flashcards
الخاصية SelectedText
الخاصية SelectedText
Signup and view all the flashcards
الخاصية Text
الخاصية Text
Signup and view all the flashcards
الخاصية TextAlign
الخاصية TextAlign
Signup and view all the flashcards
الخاصية TextLength
الخاصية TextLength
Signup and view all the flashcards
الإجراءات (Methods)
الإجراءات (Methods)
Signup and view all the flashcards
الإجراء Hide
الإجراء Hide
Signup and view all the flashcards
الإجراء Show
الإجراء Show
Signup and view all the flashcards
الإجراء AppendText
الإجراء AppendText
Signup and view all the flashcards
الإجراء Clear
الإجراء Clear
Signup and view all the flashcards
الإجراء Copy
الإجراء Copy
Signup and view all the flashcards
الإجراء Cut
الإجراء Cut
Signup and view all the flashcards
الإجراء Paste
الإجراء Paste
Signup and view all the flashcards
الإجراء SelectAll
الإجراء SelectAll
Signup and view all the flashcards
الإجراء Undo
الإجراء Undo
Signup and view all the flashcards
مربع الرسالة
مربع الرسالة
Signup and view all the flashcards
Prompt
Prompt
Signup and view all the flashcards
Title
Title
Signup and view all the flashcards
Buttons
Buttons
Signup and view all the flashcards
Icons
Icons
Signup and view all the flashcards
Study Notes
- This chapter introduces the concept of user interaction, which involves users entering data or receiving messages.
Objectives
- Explain the meaning of user interaction.
- List five common properties of the TextBox control.
- Explain the meaning of a Method.
- Apply a Method to a desired object.
- Use the method to end the application.
- Explain the meaning of a message box.
- Show a message box to the user.
- Adjust the text that appears in the message box and the text in its title bar.
- Control the buttons that appear on the message box.
- Control the icons that appear on the message box.
User Interaction
- No application (program) exists without interacting with the user, whether by allowing them to enter data or by displaying messages such as alerts and warnings.
- Texts are among the most important inputs to the computer and their form can be controlled
- Texts also have operations that can be performed on them, as learned in Windows programs, such as copying, cutting, or pasting part of the text elsewhere.
Textbox Tool
- This tool was used in previous lessons.
- Used to allow the user to enter data through it, or it can be used to display data.
- Every tool (or object) has a set of properties, events, and methods that define its appearance, behavior, and functions
Properties
- After placing the TextBox tool on the Form, its shape and format can be controlled through properties such as whether it is a single-line or multi-line box
- It can be used for entering a password or the font that appears during writing.
- These properties can be adjusted during design through the properties box, or they can be adjusted from the code window using commands.
Common Textbox Properties
- RightToLeft: Determines the writing direction. Setting it to Yes makes the direction from right to left, and setting it to No makes it from left to right, which is the default.
- CharacterCasing: The default is Normal, meaning the letters appear in the same case as they are typed. If you want the letters to appear in uppercase, set the property to Upper, and to display them in lowercase, set it to Lower.
- Font: Used to adjust the font type, size, and formatting
- MaxLength: Used to set the maximum number of characters that the user can enter in the text box.
- MultiLine: To determine if the text box is a single line, set the property to False (the default). For multiple lines, set it to True.
- PasswordChar: Used to make the text box input appear as a password, i.e., symbols appear instead of the entered letters.
- ReadOnly: The default is False. To make the contents of the text box non-editable and only for reading, set this property to True.
- Scrollbars: Used to control the appearance of scrollbars
- None: Means no scrollbars (default)
- Horizontal: To display a horizontal scrollbar
- Vertical: To display a vertical scrollbar
- Both: To display a vertical and horizontal scrollbar.
- SelectedText: This property is not set, but rather used to find out the text that has been selected in the text box. This property is not available in the properties box, but can only be used by using the code.
- Text: To place the contents of the text box or to know its contents.
- TextAlign: To adjust the alignment of the contents of the text box.
- This property can be set to Left, Right, or Center.
- TextLength: This property is also not available in the properties box, but rather used from the code. This property is used to find out the number of characters entered in the text.
Methods
- Control the shape of the tool or object
- There is a set of functions and actions that can be implemented on the Object and called Methods.
- Methods are used by writing code, not a special window like in properties.
- Methods are implemented during program execution, not at design time.
- General form of the code for using a method: ObjectName.Method;
Example
- ObjectName: name of the object
- Method: name of the method to be implemented on this object
- The Hide procedure hides the object, while the Show procedure displays it.
- Once you start typing in the code window, a box will appear showing a list of various elements such as properties and the names of the objects on the Form.
- To select the object directly from the list instead of typing it, press the Tab key from the keyboard (note the symbol that appears to the left of the names of the existing objects).
- After writing the name of the entity, and as soon as you write the dot (.) to start writing the name of the property or the procedure required, a list will appear with the names of the entity's properties and procedures that you can apply to it.
Common Methods
- AppendText: Used to add text to the text that already exists in the text box
- Clear: It clears the contents of the text box, For example Textbox1.Clear clears contents.
- Copy: Sends a copy of the part that has been selected in the text box.
- Cut: Sends the part.
Example
- Two previous actions are implemented on the object.
- For example you want to implement an action on the text inside a text box, convert it to uppercase.
- You are not dealing with a text-box object.
- You are dealing with the text, so apply the action to the text, and the text is the property of the text box: ObjectName.PropertyName.Method;
- Properties can be considered entities that have their special procedure.
- In the previous Textbox example, to convert the existing lowercase letters to uppercase, we use the ToUpper procedure, and the command form will be as follows, where we added the name of the Text property because this procedure is specific to the text entities: textBox1.Text.ToUpper();
Exercise
- Write a C#.NET program that contains two text boxes: one single-line and the other multi-line (Multiline).
- The program window also contains seven buttons to perform the required commands:
- Append Text Button
- Clear Button
- Copy Button
- Paste Button
- Select All Button
Understanding Code
- The Copy button will not perform its function of copying the selected part to the Clipboard unless the special command for this is written in the button's Event Handler
- When writing the function, double click on copy to open the function
- Button (Copy) to perform the function of copying : txtFirstBox.Copy();
btnCopy click action
- The Click event is triggered when the item is first selected
btnCut click action
- Pastes the copied text to the second text box
- txtSecondBox.Paste();
btnClear click action
- clear is to clear all the test
- txtFirstBox.Clear(); txtSecondBox.Clear();
btnUpper click action
- Make all letters Capital letters
- txtFirstBox.Text = txtFirstBox.Text.ToUpper();
btnLower click action
- Display the the contents of the txtFirstBox in lowercase letters
- txtFirstBox.Text = txtFirstBox.Text.ToLower();
btnExit click action
- The command Application.Exit() can work on any class
Message Box
- Often appears in various applications
- Displays text and options such as (Yes/No)
- (Message box) show information about errors and prompts the user to complete a task
Common Command
- MessageBox.Show(Prompt , [Title] , [Buttons], [Icons])
- Prompt : Text that is displayed to users
- Title : Message box title
- Buttons : Numbers/Text to represent
MessageBoxButtons
- Ok-Cancel, YesNo, and YesNoCancel
Message box icon
- Displays an icon in the message with a set format
Symbols (Message Box)
- Asterisk / Information
- Question
- Error
- Exclamation / Warning
- Hand / Stop
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.