This document contains answers to exercises from a chapter on standard controls in Visual Basic. The first exercise involves using a timer to move an image left or right depending on its position. The second creates an interface with three scroll bars to change the color of text. The third involves buttons to resize an image larger or smaller.
This document contains answers to exercises from a chapter on standard controls in Visual Basic. The first exercise involves using a timer to move an image left or right depending on its position. The second creates an interface with three scroll bars to change the color of text. The third involves buttons to resize an image larger or smaller.
This document contains answers to exercises from a chapter on standard controls in Visual Basic. The first exercise involves using a timer to move an image left or right depending on its position. The second creates an interface with three scroll bars to change the color of text. The third involves buttons to resize an image larger or smaller.
Answers to Exercises 1. Private Sub Timer1_Timer() If Picture1.Left ! Then Picture1.Left " Picture1.Left # 1!! $lse Picture1.Left " %orm1.&idth # Picture1.&idth $nd If $nd Sub 2. 'im () *) + Private Sub ,Scroll1_Chan-e() ( " ,Scroll1.,alue Label..Caption " ( Te/t1.%oreColor " (*+(() *) +) $nd Sub Private Sub ,Scroll0_Chan-e() * " ,Scroll0.,alue Label1.Caption " * Te/t1.%oreColor " (*+(() *) +) $nd Sub Create the interface of the exercise1 Answers Chapter 9 Standard Control II Page 2 of 3 Private Sub ,Scroll2_Chan-e() + " ,Scroll2.,alue Label3.Caption " + Te/t1.%oreColor " (*+(() *) +) $nd Sub 3. Private Sub Command1_Clic4() Ima-e1.&idth " Ima-e1.&idth 5 0 Ima-e1.6ei-ht " Ima-e1.6ei-ht 5 0 $nd Sub Private Sub Command0_Clic4() Ima-e1.&idth " Ima-e1.&idth 7 0 Ima-e1.6ei-ht " Ima-e1.6ei-ht 7 0 $nd Sub The result Interface of the Exercise 2 The Interface of the exercise 3 Answers Chapter 9 Standard Control II Page 3 of 3