Welcome  everyone Namaste My blog praveen hirachan Nepal Japan
Showing posts with label C# for beginners. Show all posts
Showing posts with label C# for beginners. Show all posts

Thursday, May 1, 2014

How to make a simple "Maze Game" using C# for beginners

Wondering how to make your first simple Game using C#. If you are new to programming world then may be you are wondering if You could actually make anything like a "GAME" in C language.
Of course, you can. Here I have again created a new tutorial video on how  to make  a simple "Maze Game" using C# for beginners.


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;

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

        private void label1_MouseEnter(object sender, EventArgs e)
        {
            MessageBox.Show("Congratulation");
            Close();
        }
        private void MoveToStart()
        {
            Point startingPoint = panel1.Location;
            startingPoint.Offset(10, 10);
            Cursor.Position = PointToScreen(startingPoint);
        }

        private void label2_MouseEnter(object sender, EventArgs e)
        {
            MoveToStart();
        }
        int flag = 0;
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (flag == 0)
            {
                label13.Enabled = true;
                label13.Visible = true;
                flag = 1;
            }
            else
            {
                label13.Enabled=false;
                label13.Visible=false;
                flag=0;
            }
        }
       

     

        

       
    }

}




Saturday, April 19, 2014

How to make "Calender using C#".

Yet another tutorial video for all those beginners who loves programming. In this video, I have created a personal calender and of course if you would like to create your own calender in your computer desktop, then watch this tutorial video. Below I have posted my video on how to make "calender using c#....".
If you like my video then
Please SUBSCRIBE



My code while making my Calender

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;

namespace Calender
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            ControlBox = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            groupBox1.Show();
        }

        private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {
            textBox1.Text = monthCalendar1.SelectionStart.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            groupBox1.Hide();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }

}




Thursday, April 17, 2014

How to make "web browser using C#"..

This video is a tutorial on "how to make Web browser  using C#". Lots of  programmer in their starting phase wants to create their own personal web browser  where they can create their own programs and setup the things and button as they wants. For those programmer, who wants to create web browser  but have no idea where to start. If you are one of those seeking the first starting point,then I must say this is the right place to start. Below, I have posted my video. watch and subscribe my channel. SUBSCRIBE


My code while making my personal Web browser

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;

namespace Browser
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void GoButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(UrlTextBox.Text) ||
                UrlTextBox.Text.Equals("about:blank"))
            {
                MessageBox.Show("Enter a valid URL.");
                UrlTextBox.Focus();
                return;
            }
            OpenURLInBrowser(UrlTextBox.Text);
        }

        private void OpenURLInBrowser(string url)
        {
            if (!url.StartsWith("http://") &&
                !url.StartsWith("https://"))
            {
                url = "http://" + url;
            }
            try
            {
                webBrowser1.Navigate(new Uri(url));
            }
            catch (System.UriFormatException)
            {
                return;
            }
        }
        private void HomeButton_Click(object sender, EventArgs e)
{
    webBrowser1.GoHome();
}

private void BackButton_Click(object sender, EventArgs e)
{
    if (webBrowser1.CanGoBack)
        webBrowser1.GoBack();
}
private void NextButton_Click(object sender, EventArgs e)
{
    if (webBrowser1.CanGoForward)
        webBrowser1.GoForward();
}
private void RefreshButton_Click(object sender, EventArgs e)
{
    webBrowser1.Refresh();
}
private void SaveButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowSaveAsDialog();
}
private void PrintPreviewButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPrintPreviewDialog();
}
private void PrintButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPrintDialog();
}
private void PropertiesButton_Click(object sender, EventArgs e)
{
    webBrowser1.ShowPropertiesDialog();
}


   
    }
}




Monday, April 14, 2014

How to make STOP WATCH in C# for beginers.

Yet another programing video. This time, I have made a Stop watch. And this video is a tutorial on "how to make STOP WATCH using C#". Basically this is for beginners , who are trying to make some programs .
Below, I have posted my video.
watch and subscribe my channel. SUBSCRIBE




Popular Posts