ControlChars.Newline Constant and Designing Default Button - Visual Basic Questions and Answers

DigitalOcean Referral Badge DigitalOcean Referral Badge

1.

The __________ constant instructs the computer to advance the insertion point to the next line in control.

   A.) ControlChars.NewLine
   B.) ControlChars.Line
   C.) ControlChars.blankLine
   D.) ControlChars.NextLine

Answer: Option 'A'

ControlChars.NewLine

The ControlChars.NewLine constant when inserted at the right location in the code, the control shifts to the next line. Thus it instructs the computer to advance the insertion point to the next line in control.

DigitalOcean Referral Badge

2.

__________ can be used to advance the insertion point in a file or on the printer.

   A.) Advance pointer
   B.) Nextpoint pointer
   C.) ControlChars.NewLine constant
   D.) NextLine constant

Answer: Option 'C'

ControlChars.NewLine constant

 The ControlChars.NewLine constant when inserted at the right location in the code, the control shifts to the next line. Thus it can be used to advance the insertion point in a file or the pointer.

DigitalOcean Referral Badge

3.

Which of the following is called the line continuation character?

   A.) *
   B.) ^
   C.)
   D.) _

Answer: Option 'D'

When a code line exceeds the view, one can use the _ to extend it code into the next line. The line continuation character must be immediately preceded by a space and appear at the end of a physical line.

DigitalOcean Referral Badge

4.

ControlChars.NewLine constant is a __________ constant.

   A.) Pure
   B.) Invariable
   C.) Character
   D.) Intrinsic

Answer: Option 'D'

Intrinsic constant is one which is built into Visual Basic. ControlChars.NewLine is inbuilt in Visual basic, that is the code for this function, that is its control is already predefined. Thus it is an intrinsic constant.

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

5.

What is wrong with the below statement?

Msg.Text=”This is an example”&ControlChars.NewLine&“Example”.

   A.) Used double quotes, should have used single quotes
   B.) No errors
   C.) There should be spaces before and after each &
   D.) Should have ended with a ;

Answer: Option 'C'

The & operator is used to concatenate strings and should be preceded and followed by a space. It is a logical operator. Thus the syntax of the above statement is wrong, as there is no space in before and after & operator.

DigitalOcean Referral Badge

6.

What is the specialty of the Default button?

   A.) Always focused by default
   B.) Always clears the form it is in
   C.) Can be selected by the Enter key even when not focused
   D.) Can be selected by the Shift key even when not focused

Answer: Option 'D'

The Default button is the one that is most commonly used and is assigned the Enter key as shortcut. Thus the Default button can be used that is it can be selected by Shift key even when not focused.

DigitalOcean Referral Badge

7.

The Cancel Button’s procedure is accessed by __________ key.

   A.) Esc
   B.) Ctrl
   C.) Shift
   D.) Alt

Answer: Option 'A'

Esc

The cancel button is assigned as the Esc key which is used to exit the current form. Thus to exit from the current form we press the Esc key since the Cancel’s button procedure is accessed by Esc key.

DigitalOcean Referral Badge

8.

How many default buttons can a form have?

   A.) 1
   B.) 2
   C.) 3
   D.) 4

Answer: Option 'A'

The default button is used to send the information of the current file. In such a case only one button is required per form. Thus a form can have only one default button, to send its own information.

DigitalOcean Referral Badge

9.

How is a default button designated?

   A.) Default keyword in the definition of the button
   B.) Setting the setfocus property to on
   C.) Keeping the button at the bottom of the form
   D.) By connecting the AcceptButton property to it

Answer: Option 'D'

By connecting the AcceptButton property to it

The AcceptButton property is used to send over the form information hence the button which calls it is set as the default button. Thus the Default Button is designated by connecting the Accept button property to it.

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

10.

What is the correct syntax to designate a default button?

   A.) Form.default=button1
   B.) Form.defaultButton=button1
   C.) Form.AcceptButton=button1
   D.) Form.focused=button1

Answer: Option 'C'

Form.AcceptButton=button1

The default button is set as form.AcceptButton=button-name. We use to set the default button using the Accept button property, thus we need to give as .AcceptButton to designate a default button in the form.

DigitalOcean Referral Badge

ControlChars.Newline Constant and Designing Default Button - Visual Basic Questions and Answers Download Pdf

Recent Posts