Intermediate C# Programming

  1. In general, what is the main purpose of a Button control?




    B. A Button control is used to perform some action when the user clicks it
  2. Which area in Visual C# do you use to create how your application will look when it is run?




    D. Design View
  3. What are two important things to remember when writing code in C#?




    B. C# is case-sensitive, and every command ends with a semicolon
  4. Which property controls the background color of a control?




    C. BackColor
  5. What is a Snap Line?




    C. A line that allows you to align controls on your form
  6. Which of the following lines of code will clear the contents of the lblOutput control?




    B. lblOutput.Text = "";
  7. Which of the following lines of code can be used to close the form, which will also end the application if only the form is running?




    B. Close()
  8. What is the name of the method that is used to highlight, or select, all of the text in a text box?




    B. SelectAll()
  9. How do you associate one set of code with multiple control events?

    A. Use the Properties area of the Properties window to select the code to associate with different
    events
    B. Use the Events area of the Properties window to select the code to associate with different events
    C. Use the Handles keyword and the different event names at the end of the event header
    D. It is not possible to associate one set of code with multiple events
    B. Use the Events area of the Properties window to select the code to associate with different events
  10. Which of the following statements will check to see if the check box named chkOption is checked?




    D. if (chkOption.Checked == true)
  11. How do you make an access key for an object on your form?




    B. Place the ampersand (&) character before the access key letter in the Text property of the control
  12. What can you do if you want to give your user direct access to one of your text boxes using the keyboard?




    A. Put a label with an access key next to the text box, and be sure that the label comes just before the text box in the tab order
  13. Which property stores the item that was selected from a list box?




    C. SelectedItem
  14. What does the following line of code do?

    int [] whatisit = new int[100];




    C. This code declares an integer array called whatisit and allocates the space for 100 integers
  15. Which of the following code segments sort the elements of an array named a, in reverse order (decreasing order)?

    A. Sort(a);
    B. Sort(a);
        Reverse(a);
    C. SortReverse(a);
    D. Reverse(a);
        Sort(a);
    • B. Sort(a);
    •     Reverse(a);
  16. When you put a ToolStrip on your form, where does Visual C# place it by default?




    A. The top of the form
  17. The TabControl control can be found in which of the following areas in the Toolbox?




    C. Containers
  18. What is the difference between the TabControl and TabPage controls?




    D. A TabControl is a container for TabPages
  19. If you want to declare a method that will be available to all code, both inside and outside the class, you should declare it with which keyword?




    B. Public
  20. In general, which of the following is correct regarding the declaration of methods and variables inside a class?




    B. Variables should be declared as Private and methods as Public
  21. All of the code contained inside a class body is enclosed in what characters?




    C. Curly braces {}
  22. Which of the following methods opens a file and write to the file starting at the end of the current file?




    C. AppendText
  23. The OpenDialog control will store the full path of the file that the user selects in which property?




    D. FileName
  24. Which method must be called in order to display an OpenFileDialog or SaveFileDialog control in your application?




    A. ShowDialog
  25. If you want to allow the user to see how a new font will look while the FontDialog control is open, what must be done?




    D. Set the ShowApply property for the FontDialog control to True
  26. Which of the following lines of code will correctly change the color of the text that the user has chose to be the color in the ColorDialogBox? Assume that the RichTextBox control's name is rtbMain and the ColorDialogBox control's name is colorDialog1.




    B. rtbMain.SelectionColor = colorDialog.Color;
  27. Which of the following properties will make the RichTextBox control resize as the application is resized?




    B. Dock
  28. Which of the following C# controls will display all of the records with all of the fields on the form?




    B. A DataGridView
  29. Which of the following controls allows you to limit the values the user is allowed to enter in a C# program?




    D. A MaskedTextBox
  30. When you create a parameterized query for your TableAdapter, which of the following is automatically added to the form?




    B. A Label, a TextBox, and a Button
  31. When using data bound item on your form, which of the following properties determines what is shown to the user in the control?




    B. DisplayMember
  32. Which property of a BindingSource object stores a String that limits the values that are stored?




    B. Filter
  33. What is the difference between modal and modeless forms?




    A. Modal forms allow the user to only work with the current form, while modeless forms allow the user to work with any form in the application
  34. What is the name of the text area that appears when you hold the mouse over a control?




    B. ToolTip
  35. Which method contains the Application.Run command that creates and loads the form for a program?




    A. Main
  36. What is the purpose of an EventHandler?




    D. An EventHandler object lets the computer know what to do when the user interacts with the object
Author
jdavis123
ID
356785
Card Set
Intermediate C# Programming
Description
Final Exam
Updated