Tag: .net

Questions Related to .net

  1. Color

  2. ColorBox

  3. ColorDialog

  4. ColorDisplay

  5. ColorDisplayBox


Correct Option: C
  1. Font.

  2. FontBox.

  3. FontDialog.

  4. FontDisplay.

  5. FontDialogBox.


Correct Option: C
Explanation:

To solve this question, the user needs to be familiar with the concept of creating dialog boxes and specifically, the font dialog box.

Now, let's go through each option and explain why it is right or wrong:

A. Font: This option is incorrect because the name "Font" does not indicate that it is specifically used for creating a font dialog box. It may refer to a class related to font manipulation, but not to the creation of a font dialog box.

B. FontBox: This option is incorrect because, similar to option A, the name "FontBox" does not specifically indicate that it is used to create a font dialog box. It may refer to a class related to font manipulation, but not to the creation of a font dialog box.

C. FontDialog: This option is correct. The name "FontDialog" specifically indicates that this class is used to create a font dialog box. It is a common naming convention in programming to use descriptive names for classes, and in this case, "FontDialog" accurately describes the purpose of the class.

D. FontDisplay: This option is incorrect because the name "FontDisplay" does not specifically indicate that it is used to create a font dialog box. It may refer to a class related to font display, but not to the creation of a font dialog box.

E. FontDialogBox: This option is incorrect because the name "FontDialogBox" is not a standard naming convention for the class used to create a font dialog box. The commonly used name is "FontDialog".

Therefore, the correct answer is:

C. FontDialog.

  1. FileName

  2. FileNames

  3. FileType

  4. Filter

  5. FilterIndex


Correct Option: D
Explanation:

To answer this question, the user needs to have knowledge of the OpenFileDialog control and its properties.

The OpenFileDialog control is a common dialog box provided by the .NET framework that allows users to browse and select files from the file system.

Now, let's go through each option and explain whether it specifies the choices in the "Files of type" dropdown box:

A. FileName: This property represents the name of the file selected in the dialog box. It does not specify the choices in the "Files of type" dropdown box.

B. FileNames: This property represents an array of file names selected in the dialog box. It does not specify the choices in the "Files of type" dropdown box.

C. FileType: This property does not exist in the OpenFileDialog control. Therefore, it does not specify the choices in the "Files of type" dropdown box.

D. Filter: This property specifies the filter string that determines the choices in the "Files of type" dropdown box. It allows you to specify the types of files that can be selected in the dialog box based on their extensions.

E. FilterIndex: This property specifies the index of the default filter to display in the "Files of type" dropdown box. It does not specify the choices in the dropdown box itself.

Therefore, the correct answer is:

D. Filter

  1. FileName

  2. Filter

  3. InitialDirectory

  4. Both a and b.

  5. All of the above.


Correct Option: E
  1. Close

  2. Peak

  3. Flush

  4. Both a and b.

  5. All of the above.


Correct Option: A
Explanation:

To solve this question, the user needs to have a basic understanding of the StreamReader and StreamWriter classes in .NET.

Option A: Close - This method is found in both the StreamReader and StreamWriter classes. It is used to close the underlying stream and free up any resources associated with it.

Option B: Peek - This method is not found in both the StreamReader and StreamWriter classes. It is only found in the StreamReader class and is used to return the next available character without reading it from the underlying stream.

Option C: Flush - This method is found in both the StreamReader and StreamWriter classes. It is used to flush the buffer and write any remaining data to the underlying stream.

Option D: Both A and B - This option is incorrect because option B is not found in both the StreamReader and StreamWriter classes.

Option E: All of the above - This option is incorrect because option B is not found in both the StreamReader and StreamWriter classes.

Therefore, the correct answer is:

The Answer is: A. Close.

  1. IO

  2. Stream

  3. StreamIO

  4. Both a and b.

  5. All of the above.


Correct Option: B
  1. PrintDialog

  2. PrintPreview

  3. PageSetupDialog

  4. Both a and b.

  5. All of the above.


Correct Option: B
  1. PrintDialog

  2. PrintPreview

  3. PageSetupDialog

  4. Both a and b.

  5. All of the above.


Correct Option: E
Explanation:

The Document property is a property of dialog controls that allows you to access the document that is being printed, previewed, or set up. All three of the dialog controls listed in the question have a Document property. Therefore, the correct answer is E. All of the above.

Explanation for Option A:

The PrintDialog dialog control is used to print a document. The Document property of the PrintDialog dialog control returns a reference to the document that is being printed.

Explanation for Option B:

The PrintPreview dialog control is used to preview a document before it is printed. The Document property of the PrintPreview dialog control returns a reference to the document that is being previewed.

Explanation for Option C:

The PageSetupDialog dialog control is used to set up the page layout for a document. The Document property of the PageSetupDialog dialog control returns a reference to the document that is being set up.

Correct Answer:

The correct answer is E. All of the above. This is because all three of the dialog controls listed in the question have a Document property.

  1. Document

  2. DocumentPage

  3. DocumentPrint

  4. PageDocument

  5. PrintDocument


Correct Option: E
  1. When the PrintDialog control is displayed.

  2. When an assignment is made to the Document property.

  3. The first time the Print method is called.

  4. Every time a page is printed after the Print method is called.

  5. None of the above.


Correct Option: D