C O D E   H E L P E R

BACK

 

C++ Native & CLI Code Examples for Visual Studio

When you need code for a specific job, then check out this list. Instead of scrounging around in your notes, I put some major code snippets here for you. In most cases they are copied from our C++ classroom projects.

 
  • STARTER APPS
  • Forms & MDI Projects (Multi-forms)
  • Color Dialog Control (How to save form backcolor and get it back later)

 

  • Changing Form Colors and the Custom ColorDialog Control sample.
  • How to trap the Form_Closing Event. Do a confirm exit with a MessageBox. Traps the X key, control box exit, and ALT-F4
  • Common Controls
  • Data Entry & Validation
  • CLR Console Version
  1. Data Entry 1
  2. Data Entry 2
  3. Data Entry 3
  • GUI Version
  • Managing Data Entry Issues

Copy selected item in Listbox to a textbox
How to
concatenate strings
Simple math operations (
computing sales tax)
How to display items & pricing as currency

  • Native Version
  1. Data Entry 1
  2. Data Entry 2
  3. Data Entry 3
  • Event Handlers
  • Using List Boxes
  • If
  • Switch
  • Loops, Inline IF statements

 

  • Formatting Strings
  • Custom Functions/Methods
  • String Functions
  • Variables & Properties
  • Running Totals & Counts
  • BitWise Operations
  • Collections, Structs. & Enumerations

 

  • Native Version

 

  • Arrays & Control Arrays
  • Delegates & Pointers (See CS131 below)
  • File I/O: Textfiles & Binary Files

 

  • Classes, Properties, Methods, Constructors & Inheritance

 

  • Native Version

 

  • Data Structures (CS131)
    • Lists (See Collections & Enumerations above)
    • Structs
    • Sorted Lists
    • Queues
    • Stacks
  • ADO and MS Access Database programming

Copyright 2017 Ronald P. Kessler, Ph.D.
All rights reserved.

Revised: 2/12/2017