Tuesday, July 12, 2011

Sample Project Math Quiz Game in windows form application

Hi! friends this is another sample project in windows form application.I have created simple Math Quiz Game 
in which players must give answer within 30 seconds.This game may not be suitable to play for entertainment but this is very helpful for reading and creating project in windows form.
     In this tutorial, I build a timed math quiz game, where the player must answer four random arithmetic problems within a specified time. You learn how to:
  • Generate random numbers using the Random class.
  • Trigger events using a Timer control.
  • Control program flow using if else statements.
  • Perform basic arithmetic operations.
In game when player fill all four answer within specific time the message box display's congratulation message if not then display's sorry message.


Here is a source code written in c sharp  copy each block of code and save them in separate file and create new project on windows form application and compile it or Download complete project from GitHub.

Tuesday, July 5, 2011

Sample project Maze game in windows form application source code

Hi! friends this is another sample project in windows form application.I have created simple Maze Game by using only labels and panel.Maze is  design by dragging and dropping in visual studio 2010.I have added start sound and game end sound also.
    In this project, user has to move the mouse pointer from the start to the finish without touching any of the walls. At the end of these project you learn how to:

  • Lay out a form using a Panel container.
  • Build a maze using Label controls.
  • Write code to show a message box.
  • Set up event handlers for mouse events.
  • Play sounds in your program.
  • Organize your code using classes.
Here's how the maze will work: The mouse pointer starts at the upper-left corner of the maze. The user navigates through the maze, being careful not to touch any of the walls with the pointer. If the pointer touches one of the walls, it automatically jumps back to the start. But if the pointer reaches the Finish label at the end of the maze, a "Congratulations" message box opens, and the game ends.


Here is a source code written in c sharp copy each block of code and save them in separate file and create new project on windows form application and compile it or Download complete project from GitHub.

Image viewer in windows form application with visual studio sample project source code


Hi! friends this is another sample project in windows form application.I have created simple image viewer project by using imageBox,checkBox,openFileDialog ,colorDialog and buttons.All these items are design by dragging and droping with visual studio 2010.Here is a source code written in c sharp copy each block of code and save them in separate file and create new project windows form application and compile it.
    In this project you can add additional feature like auto resize of image,adding next button to display next image.
Download complete from GitHub.

|--------------------------------------------------------------------------|
|                                  Program.cs                                                            |
|                                                                                                               |
|--------------------------------------------------------------------------|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;