Thompson Rivers University
Adding the Instruction Label
Assignment 5 User Interfaces FX - SM 2025Now that the window is showing up properly, let’s add the first actual piece of visible content. The instruction label at the top.
This label will tell the user how to use the program. According to the assignment instructions, it should say:
Change the square color using the radio buttons.
Change the scale of the square between 0–100% using the slider.The first visible component we want to add to our window is a label that explains how to use the program. This label will sit right at the top of the window, above all the other controls.
To create a label, we call new Label() and pass in the text we want to display. In this case, we include \n between the two sentences to split the message into two lines. This keeps it readable and clear.
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 54 more lessons in Thompson Rivers University.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.