Abraham Morales
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Exam 2 review sheet ###### tags: `Exam 2` ## Windows Forms programming form = window Widget/Control = Software component that a user manipulates to interact with an application. ## Windows Forms Application Program.cs - Application.Run() This file is rarely edited. **Form1.cs – inherits Form** All forms are inherited from Form1 class. File is partial since it is defined in another file (Form1.Desginer.cs). The apps main logic goes here. **Form1.Designer.cs – InitializeComponent()** The compiler declares it automatically and there is where we intanciate componenet that make up our window. **Event-driven programming** Callback and event handler are functions which are called whenever user clicks a button * +=/-= to register/deregister event handlers That's in order to register for an event. -= is in case I don't want you to call a function (not commonly used) += it's by default in event handlers to call functions when clicking * Event handler parameters: sender and EventArgs **Sender** is an object where the event occurs, like ToString, hash value, equals it has properties.. it gets info of the click, by creating a variable to store the object (button, textbox..etc) we can modify it. **Event Args** is event data. **Controls** MenuStrip: ![](https://i.imgur.com/r0gvv54.png) Label: ![](https://i.imgur.com/yjFGiwB.png) Button: ![](https://i.imgur.com/f8kFdy6.png) TextBox: ![](https://i.imgur.com/qrQPh99.png) Open text RadioButton: ![](https://i.imgur.com/sGozFzb.png) You can choose only one. CheckBox: ![](https://i.imgur.com/s5Bi3fI.png) You can choose more than one. ComboBox: ![](https://i.imgur.com/8XtlD58.png) Options but you can choose one **Icon file .ico** It has a bitmap **Paint event and Invalidate()** **Paint event** is where we draw the squares based on a grid, bollean values, when we modify the array by clicking on we are calling the **invalidate** function. We allow Windows to call it. **Separating GUI logic from business logic** Separating from different classes **Dialog boxes** **Modal vs. modeless** When a modal dialog is open you cannot interact with anything else than this modal dialog inside your program, as long as the modal dialog is open. Most dialogs are modal, for example the File-Save As dialogs are modal. On the other hand a modeless dialog behaves just like a normal window, you can do anything you want while it is open. The spell checker dialog in Microsoft Word is an example of such a dialog. **MessageBox class** Displays a message window, also known as a dialog box, which presents a message to the user. It is a modal window, blocking other actions in the application until the user closes it. ```C# string message = "You did not enter a server name. Cancel this operation?"; string caption = "Error Detected in Input"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; MessageBox.Show(message, caption, buttons); ``` **Form methods ShowDialog() vs. Show()** *Show* displays the form in a non-modal way. *ShowDialog* displays the form in a modal way. **DialogResult enum** DialogResult is returned by dialogs after dismissal. It indicates which button was clicked on the dialog by the user. It is used with the MessageBox.Show method. It is a value. It can be switched upon and tested in an if-statement. Example. This is a Windows Forms program that uses a Form1_Load event handler. We show a MessageBox with the OK and Cancel buttons (seen in the screenshot). We use the MessageBox.Show method for this. **Usability principles** - Unless the dialog box should be resizable (which is rare), remove the ability to resize the dialog box and remove the maximize button - FormBorderStyle = FixedDialog - MaximizeBox = False - Always have OK and Cancel buttons available, and make the Cancel button reset the dialog box back to its original configuration - Closing the dialog box via the close button (X) on the title bar should have the same effect as pressing Cancel - In Windows, OK is always on the left, Cancel on the right - Don't use scrollable dialog boxes, menu bars, or status bars - Modal & Nonmodal Dialogs: When (& When Not) to Use Them - Confirmation Dialogs Can Prevent User Errors — If Not Overused - Windows User Experience Interation Guidelines for Dialog Boxes **Observer design pattern** **Observer (main form) vs. Subject (dialog box) Registration, notification, deregistration** Registration is in the observer what you want to be notified. notification tells the observer that something occured. deregistration, we don't need it because we are interested in registrarion. **Creating events, delegates, and triggering events** **Common dialog boxes** Color, font, folder, open, save, print ```c# ColorDialog dlg = new ColorDialog(); dlg.ShowDialog(); //or also FontDialog(); OpenFileDialog(); PrintDialog(); OpenFileDialog theDialog = new OpenFileDialog(); theDialog.ShowDialog(); SaveFileDialog SaveFileDialog1 = new SaveFileDialog(); theDialog.ShowDialog(); ``` GUI BLOOPERS!!! Like the thumbs down Look for more! # Chapter 2 – Our Vision is Optimized to See Structure **Gestalt principles:** * Proximity * Principle of Proximity is that the relative distance between objects in a display affects our perception of whether and how the objects are organized into subgroups. * It showed that group boxes and separators were not necessary because the related controls were visually spaced closer together. * Similarity * Where objects that look similar appear grouped. * Continuity * The principle of Continuity, states that our visual perception is biased to perceive continuous forms rather than disconnected segments. * ![](https://i.imgur.com/3l9tGB9.png) * Closure * Closure, which states that our visual system automatically tries to close open figures so that they are perceived as whole objects rather than separate pieces * Symmetry * Symmetry, It states that we tend to parse complex scenes in a way that reduces the complexity. * ![](https://i.imgur.com/05XEWh5.png) * Figure/ground * How our visual system structures the data it receives. * This principle states that our mind separates the visual field into the figure (the foreground) and ground (the background). * ![](https://i.imgur.com/uBMnzfJ.png) * Common fate * Common Fate—concerns moving objects. * The Common Fate principle states that objects that move together are perceived as grouped or related. --- * (Quiz question chapter 2) * When a website displays content on top of the page content, they are making use of what Gestalt principle? : * Click for Answer * What Gestalt principle states that objects that move together are perceived as grouped or related? : * Click for Answer * T/F The Gestalt Similarity principle states that objects that look similar appear grouped (all other things being equal): * Click for Answer * The slider control that depicts a single range controlled by a handle is a prime example of what Gestalt principle? : * Click for Answer * T/F Typically Gestalt principles work in isolation. * Click for Answer * According to the text, what Gestalt principle did Escher often exploit in his drawings? * Click for Answer * What Gestalt principle states that we tend to parse complex scenes in a way that reduces the complexity? * Click for Answer * What Gestalt principle is used by GUIs to represent collections of objects like documents or messages as stacks so that showing one whole object and the edges of others "behind" it is enough to make users perceive a whole stack of objects? * Click for Answer * The Gestalt principles were theories developed by a group of German psychologists lead by Dr. Gestalt. * Click for Answer * (T/F) For information displays to be easy to scan, all that is necessary is to make them terse, structured, and non-repetitious. * Click for Answer --- # Chapter 3 – We Seek and Use Visual Structure * Seeking and seeing structure: * Users seek organization and structure when they are quickly searching for information. * Bad designs * Compare Bad design:![](https://i.imgur.com/oSF3usk.png) * and good design: ![](https://i.imgur.com/5wzkrvx.png) * The second design factors out needless repetition and marks as links only the words that represent options. It consumes less screen space and is easy * Scanning long numbers * Long numbers can be broken up in two ways. Either the user interface breaks it up explicitly by providing a separate field for each part of the number, or the interface provides a single number field but lets users break the number into parts with spaces or punctuation. * Not breaking up long numbers makes it difficult for the user to scan or verify they typed it correctly. CONSIDERED USER INTERFACE DESIGN BLOOPER. * ![](https://i.imgur.com/R2At3IO.png) * Segmented data fields * Segmented data fields can provide useful visual structure even **when the data to be entered is not a number**. Dates are example * ![](https://i.imgur.com/IHU5FDj.png) * Data-specific controls: Instead of using simple text fields, desingers can use controls that are designed specfically to display a value of a specific type. For example dates can be presented in the form of menus combined with pop up calendear controls. * Visual hierarchy does the following: * Breaks the information into distinct sections, and breaks large sections into subsections * Labels each section and sbusection prominently and in such a way as to clearly identify its content * Presents the sections and subsections as a hierarchy, with higher-level sections presented more strongly than lower-level ones. * Visual hierarchy allows people, when scanning information, to instantly separate what is relevant to their goals from what is irrelevant. --- * (Quiz questions chapter 3) * (T/F) Jeff Johnson suggests that credit card entry fields should not allow the user to enter spaces or dashes along with the numbers. * Click for Answer * (T/F) Data-specific controls should not be mixed with text field controls. * Click for Answer * (T/F) When scanning information, a visual hierarchy allows readers to instantly separate what is relevant to their goals from what is irrelevant. * Click for Answer # Chapter 4 – Our Color Vision is Limited * THe retina has two type of light receptors: * Rods detect light levels but not colors * Cones detect colors * Low Frequency: These cones are sensitive to light over almost the entire range of visible light, but are most sensitive to the middle (yellow) and low (red) frequencies * Medium Frequency: These cones respond to light ranging from the high-frequency blues through the lower middle-frequency yellows and oranges. Overall, they are less sensitive than the low-frequency cones. * High Frequency: These cones are most sensitive to light at the upper end of the visible light spectrum—violets and blues—but they also respond weakly to middle frequencies, such as green. These cones are much less sensitive overall than the other two types of cones, and also less numerous. One result is that our eyes are much less sensitive to blues and violets than to other colors. Contrast vs. Brightness: VIsion is optimized for contrsting colors not brightness. * Discriminating between colors * Paleness: The paler (less saturated) two colos are, the harder it is to tell them apart * Color patch size: The smaller or thinner objects are, the harder it is to distinguish their colors. * Separation: The more separated color patches are, the more difficult it is to distinguish their colors, especially if the separation is great enough to require eye motion between patches * Color-blindness: Wheter colors can be distinguished by people who have common types of color-blindness. * The most common type of color-blindness is red–green; other types are much rarer * External factors: * Variation among color displays * Grayscale displays * Display angle * Ambient illumination * Guidelines for using colors: * Distinguish colors by saturation and brightness as well as hue * avoid subtle color differences * Use distinctive colors * Use red, gree, yellow, blue, black and white * Avoid color pairs that color blind people cannot distinguish * Use color redundantly with other cues. * Maybe use a symbol as well with color * Separate strong opponent colors * Placing opponent colors right next to or on top of each other casues a disturbing shimmering sensation, and so it shoulb be avoided

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully