Wednesday, October 3

Brick Out Game C# Language(Complete Source Code)

Download Here: Brick Out Game c# Language
Video Tutorial:




Ball.cs File Code



using System;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace BrickOut
{
/// <summary>
/// 
/// </summary>
public class Ball : GameObject
{
        public int XStep = 5;
        public int YStep = 5;

3D Cube WPF C# Language

Download Here: 3D_Cube_Wpf


XAML Code:


<Window x:Class="_3dCube.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Viewport3D Name="viewport3D1">
            <Viewport3D.Camera>
                <PerspectiveCamera x:Name="camMain" Position="6 5 4" LookDirection="-6 -5 -4">

Slide Show Windows Form Application

Download Here: Image Slide Show
c# Code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;

namespace imageShow
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
           

            timer1.Enabled = true;
           // int i = 1;
            timer1.Tick += new EventHandler(timer1_Tick);
            timer1.Interval = (2000);
        }
        int i = 1;
        private void timer1_Tick(object sender, EventArgs e)
        {
            pictureBox1.BackgroundImage = Image.FromFile(@"images\"+i.ToString()+".jpg");
            i++;
            if (i == 8)
            {
                i = 1;
            }
        }

    }
}

Threads in c#


Threads are subtasks in a program that can be in execution concurrently.
The concurrency that computers perform today is normally implemented as operating system primitives” available only to highly experienced “systems programmers.”

Namespace: using System.Threading

C# Code:

namespace threads
{
    class Program
    {
        static void Main(string[] args)
        {

            Thread t = new Thread(new ThreadStart(threadMethod));
            t.Start();
            Console.ReadLine();
        }
        public static void threadMethod()
        {       
            Console.WriteLine("Thread is running");
            Thread.Sleep(10000);
        }
    }
}


Sunday, September 30

Drag Object with click event inside Window (WPF c# application)

NameSpace: System.Windows.Controls.Primitives.Thumb
Download Here



The Thumb control provides drag functionality that can be used to move or resize controls by monitoring the DragStartedDragDelta and DragCompleted events of the Thumb.
The user begins a drag operation by pressing the left mouse button when the mouse pointer is paused on the Thumb control. The drag operation continues as long as the left mouse button remains pressed. During the drag operation, the DragDelta can occur more than once. Each time it occurs, the DragDeltaEventArgs class provides the change in position that corresponds to the change in mouse position. When the user releases the left mouse button, the drag operation is finished. The drag operation only provides new coordinates; it does not automatically reposition the Thumb.

Thursday, July 19

Reflection Effect in WPF (XAML Code)


Refection effect in wpf(Windows Presentation foundation) very simple application. First of all start a wpf project then drag and drop rectangle control on the mainWindow. In this illustration I’m using rectangle control you can either use border control and image control according to your requirements. Fill the desired gradient in rectangle you just dropped on the mainWindow.