Showing posts with label C# code. Show all posts
Showing posts with label C# code. Show all posts

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">

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);
        }
    }
}


Tuesday, July 17

MYSQL Connection with C# WPF Application

Download Here: MySQL_C#WPF_Connection
Hello guys, today i’m gonna teach you how to connect MYSQL with MS visual studio c#. This tutorial is about MySQL workbench 5.2 and MySQL server 5.5, make sure both are installed in your PC.so let’s get started first of all open MySQL workbench 5.2 then click on New Server Instance. And follow the steps to configure your server. When you are done make a database let’s say I made a database name “Text” and Server name is Localhost.

Friday, January 27

Create custom window in Wpf Application


Hello Once again, today tutorial is about how to create a custom window in wpf application, and how to integrate this application like other normal window by adding functionality into it. So without any further delay let’s get started, this tutorial is based on WPF technology, in which you code in xaml and c# languages, WPF is an acronym for Windows Presentation Foundation, Microsoft Visual studio c# 2010 or lower version are built with WPF technology.

Tuesday, January 17

Media Player Guide in WPF (XAML) and c# code

Hello Guys, today i'm gonna show you how to make media player in wpf application, its very simple, so lets get started.
Steps

  • Lets begin with xaml (Designe) code of application. Wpf provides Media Element control which is used to load media files, in the toolbox you will find it, you can drag and drop onto your mainWindow or write a xaml code, Media Element is the class so in the angular brackets you will write MediaElement then you will give Name to your Media Element, Name is same like you are creating an object of respective class.

Friday, January 13

Paint Application in WPF (XAML) and C# Code

Hello guys, today i'm gonna show you how to make a simple paint application in wpf application using XAML for its GUI and c# for its back end coding, this application is equipped with Buttons, labels and InkCanvas,
so lets start it, first of all open MS visual Studio C# 2010, open a new project (WPF application), you will be shown a window, in the designer window we will make GUI of application, here is the screenshot, you have to follow these steps to make this application.
  • Divide your main Grid into two columns by writing this code

            <Grid.ColumnDefinitions >
                  <ColumnDefinition Width="100*" />
                    <ColumnDefinition Width="425*" />
                  </Grid.ColumnDefinitions>


          Tuesday, January 3

          LUDO Board in WPF (XAML) Code




          <Window x:Class="WpfApplication1.MainWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  Title="MainWindow" Height="500" Width="500">

          Monday, January 2

          Chess Board in WPF (XAML) code


          <Window x:Class="WpfApplication1.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">

          Sunday, October 23

          Characters Validation in Name field using C-sharp Language

          The following program is to validate name field. There is a methods which is user defined named as checkEntry which is taking string as an argument. In this method a loop is used which is starting from 0 to string length. Code is pretty simple and anyone can understand it very easily. You will some useless variable and class in this code. You do not need to create another class and user defined method. This can be done in main method. Copy code from user defined method and paste it in main method and handle this in a loop as per requirement i have used 'while' loop here.

          Sunday, October 9

          Composition Concept using C-sharp language source code


          Composition is basically has a relationship and deals with the object creation in different classes. It is different from Inheritance. Object composition is a way to combine simple objects into more complex ones. Compositions are a critical building block of many basic data structures, including the tagged union, the linked list, and the binary tree, as well as the object used in object-oriented programming. Composited  objects are often referred to as having a "has a" relationship.

          Friday, October 7

          Exception Handling using C-Sharp Language


          Exception occurs when user tries enters an invalid value like we have provided user with an application to enter an interger and he/she enters a string value as in input. If the exception is not handled at this point then your application will crash ultimately. Exceptions are unforeseen errors that happen in your programs. Most of the time, you can, and should, detect and handle program errors in your code. In lower level languages exceptions are not being handled. But if you move to the higher level language like c-Sharp, java. Microsoft provides special techniques to the developer so by using these methods properly you can protect your application from being crashed.

          Find Maximum Value using Reference-type C-sharp Language Code


          The code below will allow a user to enter differnet values of float type and after that you will be shown a maximum value which is existing in array of float type. Method which is marked as maxValue is taking two arguments first is an array which has a predefined size and the next one is max value. array is of one dimensional. In maxValue method a loop structure is implemented which will start from the zero to the size of array - 1.