QUIZ

CHAPTER 5

Your Name:


5.1 The closest alternative word for a GUI window is a

(a) component
(b) form
(c) control
(d) menu

5.2 The @ symbol at the beginning of a Views specification string indicates that what follows is

(a) in XML notation
(b) in Views XML notation
(c) a multi-line string
(d) not strictly capitalized

5.3 The Views method GetControl returns a value of type

(a) string
(b) Views.Form
(c) Button
(d) Control

5.4 Which method call would we use to write text into a ListBox control which was set up with the following Views tag?

	<ListBox Name=history Text=Results/>
(a) PutText(Results, "Answer is ");
(b) PutText("Results", "Answer is ");
(c) PutText(history, "Answer is ");
(d) PutText("history", "Answer is ");

5.5 To read an integer from a TextBox "T", we would use

(a)

	string s = f.GetText("T");
	int n = int.Parse(s);
(b)
	string s=f.GetValue("T");
	int n = int.Parse(s);
(c)
	int n = f.GetValue("T");
(d)
	int n = f.GetNumber(s);

5.6 If we were showing the number of seconds elapsed in a computation scheduled to last about two minutes, what would be the best control to use?

(a) A TextBox
(b) A TrackBar
(c) A ProgressBar
(d) A ListBox

5.7 The ActionPerformed method is called from

(a) the Go method
(b) the GetControl method
(c) the operating system
(d) anywhere the programmer chooses

5.8 The attribute Text={0} in a Views specification spec instantiated with

	Views.form f = new Views.Form(spec,p);
means that Text will have the value

(a) 0
(b) null
(c) ""
(d) p[0]

5.9 halign and valign are usually written without capital letters in Views XML because they are

(a) associated with alignment rather than values
(b) not directly associated with Windows forms properties
(c) attributes
(d) unnested tags

5.10 If a Views specification gives

	<PictureBox Name=image Image=daughter.jpg/>
how would we access the image directly to change its height to newValue?

(a)
	PictureBox p = form["Image"];
	p.Height = newValue;

(b)
	PictureBox p = form["image"];
	p.Height = newValue;

(c)
	PictureBox p = form["Image"];
	p.Image.Height = newValue;

(d)
	PictureBox p = form["daughter.jpg"];
	p.Height = newValue;