Photo AI

Write code in the "OnCreate" event handler of the Form to change the text displayed on the pnl01_1 panel as follows when the program is executed: - Assign the existing text from the panel to a variable - NSC Information Technology - Question 1 - 2018 - Paper 1

Question icon

Question 1

Write-code-in-the-"OnCreate"-event-handler-of-the-Form-to-change-the-text-displayed-on-the-pnl01_1-panel-as-follows-when-the-program-is-executed:----Assign-the-existing-text-from-the-panel-to-a-variable-NSC Information Technology-Question 1-2018-Paper 1.png

Write code in the "OnCreate" event handler of the Form to change the text displayed on the pnl01_1 panel as follows when the program is executed: - Assign the exist... show full transcript

Worked Solution & Example Answer:Write code in the "OnCreate" event handler of the Form to change the text displayed on the pnl01_1 panel as follows when the program is executed: - Assign the existing text from the panel to a variable - NSC Information Technology - Question 1 - 2018 - Paper 1

Step 1

Assign the existing text from the panel to a variable.

96%

114 rated

Answer

Retrieve the current text displayed on the pnl01_1 panel and assign it to a variable, for example, string existingText = pnl01_1.Text;.

Step 2

Add a dash "-" and use the relevant function to also add the system date to the text.

99%

104 rated

Answer

Use the DateTime.Now function to get the current date and concatenate it with the existing text and a dash. For example: string newText = existingText + " - " + DateTime.Now.ToString("yyyy/MM/dd");.

Step 3

Change the text to upper case and display the text in bold.

96%

101 rated

Answer

Modify the new text to be in upper case by using newText.ToUpper(), and set the Font.Bold property for the panel before assigning the modified text back to it: pnl01_1.Font.Bold = true; pnl01_1.Text = newText.ToUpper();.

Join the NSC students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;