-->

Friday, August 23, 2013

Virtual class room project in ASP.NET

Introduction 
A virtual class can conduct online classes by some tutors.Virtual class is a way of representing logical education.
Project contain facilities
  • Add new students 
  • Online payment
  • Admin panel
  • Tutor panel
  • Add new Tutor with tutor-id
  • Session tracking
  • Feed back System
  • Student Query generation 
Add New Student module: In which we can add new student with student profile such as student name , Student college name , payment detail etc.


Admin panel : In which a administrator can hold all activity such as : Add new tutors , Approve tutors , Approve students detail , monitor work done by tutor etc.
Tutor panel : A tutor can upload files within in current time.Solve queries generated by students using FAQ

Requirement of the application

  • Visual Studio 2010 
  • SqlServer 2008
How to run your Application 
First you need to fulfill requirement which is above mentioned. After that open your website in visual studio 2010 and run your application.
Steps for Executing your application
  • First register in Student panel
  • Second register in Admin panel and approve student which is currently registered
  • Add new tutor
  • Assign tutor-id to tutor
  • Login in tutor panel also login in student panel
  • Add files using upload facilities in tutor panel
  • check files in student panel
Virtual class room project in ASP.NET

If you want to purchase this please contact me on :  narenkumar851@gmail.com

FileDialogBox control in Windows Forms

It is an abstract class, therefore we cannot instantiate it directly. We can use OpenFileDialog or SaveFileDialog to open a file or to save a file respectively. Just run the open or save dialog boxes is not sufficient to open or save a file, we have to use I/O streams to do these simple tasks.

OpenFileDialog

To open an existing file and see the content of that file, OpenFileDialog box is used. It is same in all window application as shown in following image:

OpenFileDialog Box Control in windows forms

To open this dialog box just add an open file dialog control from toolbox and write openFileDialog1.ShowDialog(); in the click event of button.


SaveFileDialog 

To save a file after creating of modifying you have to save that file using SaveFileDialog box at the specified location. Following figure shows the preview of SaveFileDialog box.

SaveFileDialog Box Control in windows forms

To open this dialog box the same procedure will be followed up. Just add a SaveFileDialog and write saveFileDialog1.ShowDialog(); in the click event of button.

To open these type of dialog boxes we have to create an object of respective class and then call its ShowDialog() method:
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.ShowDialog();


FolderBrowserDialog Box Control

Font Dialog Box Control in Windows Forms

While working on windows-based application, you might have to change the font size, style or related to font. Just like MS-Word there should be a font dialog box to differentiate some text from common text in the file. This can be done using Font Dialog box shown in following image:


To add this box just drag-n-drop font dialog control from the toolbox. Add a textbox and a button on the form with text property “change font”. Button will used to show the font dialog box and then all the changes made in dialog box will appear in the text box.



By default a textbox has Microsoft Sans Serif as font, Regular as font style and 8 as font size. Now change these values as
  • Font = Monotype Corsiva
  • FontStyle = Bold
  • FontSize = 12
from the font dialog box and then click on ok button. We can see the text has been changed in our textbox as in following diagram.


Following code has to be written in the click event of button to perform these simple task:
private void changeFont_Click(object sender, EventArgs e)
{
fontDialog1.ShowDialog();
textBox1.Font = fontDialog1.Font;
}

FileDialogBox Control

ColorDialogBox Control in Windows Forms

Common dialog class is the base class for displaying common dialog boxes. One can access these boxes like Font dialog box, Open dialog box, Print dialog box etc. by using inherited classes of this base class. All these inherited classes overrides RunDialog() method which is automatically called when user calls the ShowDialog() method.

Color Dialog Box

To change the color of anything you want like text color, background color or foreground color of any control dynamically, we can use color dialog box. A simple look on color dialog box:

Preview of color Dialog Box

To add this box just drag-n-drop color dialog control from the toolbox. Add a textbox and two buttons on the form with text property background and foreground respectively as shown in the following image:


Write the following code snippet (C# language) in click event of both button respectively:
private void backgroundButton_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
textBox1.BackColor = colorDialog1.Color;
}
private void foregroundButton_Click(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
textBox1.ForeColor = colorDialog1.Color;
}
Now look out the text box, it have been changed its background color to and also foreground color as shown in following image.


So it is so easy to change color of any control’s background or foreground property.

FontDialogBox Control

Error Provider Control in Windows Forms

When using validation, programmer should have notify a message if there is a problem with the input entry. That notification can be shown using message box, status label control etc. The one more control to notify an error message to user is error provider control.

Error provider control can be used to display an error message, whenever the user positions the mouse pointer over the error icon. To add an error provider control, you can drag-n-drop it from the toolbox to the form. Some of the properties of this control are:
  • BlinkStyle: whether the error icon blinks or not when an error is set.
  • BlinkRate: rate at which the error icon blinks.
  • ContainerControl: contains the controls on which this control can display icons.


Here are some methods which are mostly used with error provider:
  • Clear(): clear all the errors associated with it.
  • GetError(): returns current error string for the specified control.
  • SetError(): set the error for specified control.
To set an error for a textbox when user left empty, drag-n-drop a textbox, button and an error provider control on a form. On the click event of button write following code in C# language:
if (textBox1.Text == string.Empty)
{
textBox1.Focus();
errorProvider1.SetError(textBox1, "This may not be Empty");
}
When we run the form and click on the button without writing anything in the textbox, then an error icon will blink just after the textbox with a message shown as a tool tip of the icon.

Error provider control in windows forms C#

Here in the code a method SetError() have been used, it takes two parameters, one for the control (to which error will be associated) and the second for the message to be shown. A single error provider can easily be used with more than one control.

Thursday, August 22, 2013

XNA Game : SquareChase

The Basic Aim of the Game
In SquareChase , we will generate randomly positioned squares of different colors while the user attempt to catch them with their mouse pointer before they disappear .

System requirements of the project
First you need to install visual c# 2010 and XNA framework extensions.Your system has support graphics card (Shader Model 1.1 Support, Direct X 9.0 support)

How to design the game
First you need to initialize the graphics object in your XNA Game class constructor.

graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";

Make the mouse pointer visible by adding the following before the call to 

base.Initialize();

this.IsMouseVisible = true;

here is the one override Initialize()  method is to call LoadContent() when the normal initialization has completed. The method is used to read in any graphical and audio resources your game will need.

Screenshot of the game
XNA Game : SquareChase

Project Source code



Wednesday, August 21, 2013

Status Strip Container Control in Windows Forms

StatusStrip container control is used to display objects that are on the current form and also to provide feedback on the progress of any progress of any operation being performed by the form. Some of the properties of this container control are:
  • Items: collection of items to be displayed on the control.
  • LayoutStyle: specifies the layout orientation of the control.
  • Dock: defines the border of control which will bind to the parent control.
Status strip control contains four child controls that can be placed as and when required. The child controls are:

Status Label Control

Works as a Label control. Used to display status information and prompt the user for a valid entry. It has some properties to be used by programmer like
  • Text: text to be displayed on the control.
  • Spring: whether the item fills up the remaining space or not. It is a Boolean type property.
  • TextAlign: specify the alignment of the text.

ProgressBar Control

Used to show the status of the task performing by the user. Represent window progress bar control. Some properties of this control are:
  • Minimum: lower bound of the range.
  • Maximum: upper bound of the range.
  • Value: current value to be set on this control.
  • Step: value to be increment/decrement.

DropDown Button Control

Displays toolStripDropDown from which user can select one item at a time. Generally used when the items to be displayed on StatusStrip cannot be accommodated. Some of the properties of this control are:
  • DisplayStyle: whether the text or image to be displayed.
  • DoubleClickEnabled: whether the double click event will occur.
  • DropDownItems: specifies the toolStripItem when the item is clicked.

SplitButton Control

It is a combination of a standard button and a drop-down button on the left and right respectively. Some of the properties are:
  • DisplayStyle: whether the text or image to be displayed.
  • DoubleClickEnabled: whether the double click event will occur.
  • Padding: internal spacing within the item.
The following image shown all the four controls of the StatusStrip control.

StatusStrip Container control in windows forms

Error Provider Control
© Copyright 2013 Computer Programming | All Right Reserved