Personal C Sharp         by    famsoft.org

Home | Demonstrative Examples | PC# Methods | PC# Reference | Links

Demonstrative Examples

See index at bottom. 

 

demos.jpg

For more complete information, visit our new website at:
 
                                http://www.famsoft.org
 
How to learn PC#:
Go through all Examples in order, starting with first example in first Group. Read the
example codes and the tutorials Keep a printed copies of "PC# Reference" and "PC# methods"
 by your side. Look through them when you feel that you need more details about an item. 
 
INDEX
 
Click on a group name to see example's code and explanation.
 
First Grouop: General - I
Second Grouop: General II
Third Grouop: Using Controls
Fourth Grouop: Drawings I
Fifth Grouop: Drawings II
Sixth Group: Filing
Seventh Group: Networking
Eights Group: Handling Threads
Nineth Group: Accessing External Objects
 
 
First Grouop: General - I
EXAMPLE 1:  The simplest program to display the message "Hello World!".
EXAMPLE 2: Two more ways to display the same message.
EXAMPLE 3: Using a much better display.
EXAMPLE 4: Creating a menu which gives the user the choice of displaying the "Hello World!"
message in either red, blue or green colors. Each time the user selects one color, the message
will be displayed in that color then the menu will appear again to allow him a new choice.
 
Second Grouop: General II
EXAMPLE 5: Creating a set of menues to show how to do most programming tasls in PC# which
do not involve graphics.
EXAMPLE 6: Using the Console instead of the "Text Screen" for text input and output.

Third Grouop: Using Controls
EXAMPLE 1:  Creating a button and a text field. If the user enters "red", "green" or "blue"
into the text field then clicks the button, the button's background color changes accordingly.
 
EXAMPLE 2: Shows how to create and handle events of several controls with variety of sizes, colors, fonts
and texts. Several Buttons, Text fields and a Combo Box are used. It sows how to use the events
received from one control affects the contents of another.
 
EXAMPLE 3: Shows how to create and handle events of "Radio Button groups, "Check box groups",
single and multi item "List Box" sets. It also shows how to create and write text into text areas.
 
EXAMPLE 4: Discussing some layout considerations using the same form which has been
generated in Example 3 for the discussion.
 
EXAMPLE 5: Graphical menu's.  Creating and handling events of 3 menu groups. The first one which is of type
"MainMenu" is installed at the top of the form.  The Second one which is of type "ContextMenu" is installed at a
specific location within the form. The third one which is also of type "ContextMenu" is attached to a button.
Whenever the user Right-Clicks the button, the menu appears.
 
EXAMPLE 6: Installing  "Tooltips" and  using "Background Images" for controls.
Fourth Grouop:
Drawings I
EXAMPLE 1: Startup program. Plotting X,Y axis then drawing some shapes using Cartisian
and Polar coordinates.
EXAMPLE 2: Application which shows the need for Polar coordinates.
EXAMPLE 3: Demonstrating the value of "Shear" and "Rotation". Drawing a diamond shaped
object or a parallelogram.
EXAMPLE 4: Drawing both sides of an ace of diamonds card using gradiant paint to decorate
its back side.
EXAMPLE 5: Drawing an "ace of hearts"?
EXAMPLE 6: Giving our drawings 3-D look using 4 different methods.
EXAMPLE 7: Using Special Effects - Depth. Display text in large size letters with 3-D look.
EXAMPLE 8: Using Special Effects - Reflection. Drawing a piece of jewelry.
 
Fifth Grouop: Drawings II
EXAMPLE 9: Drawing shadows and the use of Affine transform.
EXAMPLE 10: This example shows how to make the object you are drawing looks elevated up
or down.
EXAMPLE 11: Saving our drawing into file.
EXAMPLE 12: Reading the file back and drawing the image.
EXAMPLE 13: How to handle a mixture of Controls and drawings and how to make them control
each others.
EXAMPLE 14: Printing text lines, text files bitmap object withdifferent setup options.
EXAMPLE 15: Printing a full page of text and drawings.
 
Sixth Group: Filing
EXAMPLE 1: Reading a Sequencial Access File (SAF) using two modes, "read all" and "read line".
EXAMPLE 2: Demonstrates writing, appending and reading back of a Sequencial Access File (SAF)
EXAMPLE 3: Shows how to obtain current directory name, how to check if a file or directory
exists, how to create files and dir's and how to delete them, how to get a list of all
files & sub-folders in a folder and how to copy one file to another.
EXAMPLE 4: Show how to write 2 lines into a no header Random Access File (RAF) then read them back.
EXAMPLE 5: Shows how to make a RAF with a header containing all information necessary for reading it.
It also shows how to enter two records of data into the file then read them back.
Seventh Group: Networking
EXAMPLE 1:  Writing a program which we can run at any time to get the latest stock
price of Microsoft from Yahoo's Financial website.
EXAMPLE 2: Shows how to use FTP protocol to upload and down load files, create and delete files and
directories at your website.
EXAMPLE 3: Shows how to send an e-mail message with an attachment file programatically.
EXAMPLE 4: Shows how to check for new e-mail messages, how to retrieve a message and how to delete
a messages programatically.
EXAMPLE 5: Shows how to use lower level TCP-IP networking to connect to a server and exchange
messages with it then close the connection.
 
Eights Group: Handling Threads
EXAMPLE 1: Shows how PC# has made writing a thread safe program so easy, simple and error free.
 
EXAMPLE 2: Shows how to do graphics in a multi-thread environment.
 
EXAMPLE #: Shows how threads can communicate together and share a common project.
 
EXAMPLE 1: Shows how to do one network troubleshooting technique programatically. The IPCONFIG utility
is executed to obtain TCP-IP configuration values. Its text output is searched and the WAN IP address
is obtained then the PING utility is used to check the connection.
 
EXAMPLE 2: Shows how to write a script file then execute it with a C# program.