Saturday, 14 October 2017

how to change progress bar color

public NewProgressBar()
    {
        this.SetStyle(ControlStyles.UserPaint, true);
    }

    protected override void OnPaint(PaintEventArgs e)
    {
        Rectangle rec = e.ClipRectangle;

        rec.Width = (int)(rec.Width * ((double)Value / Maximum)) - 4;
        if(ProgressBarRenderer.IsSupported)
           ProgressBarRenderer.DrawHorizontalBar(e.Graphics, e.ClipRectangle);
        rec.Height = rec.Height - 4;
        e.Graphics.FillRectangle(Brushes.Red, 2, 2, rec.Width, rec.Height);
    }

Friday, 13 October 2017

How to make simple and easy Services page of a E-Commerce website in 15 minutes

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>About Us</title>
<link href="../css/style.css" rel="stylesheet"  type="text/css"/>

<style>

 table td p
{ font-family:"Comic Sans MS", cursive;
}

td
{
padding:20px;
}
td:hover
{ background-color:rgb(255,190,0);
border:2px solid rgb(255,190,0);
color:white;
}



 </style>

</head>

<body>

<div id="warpper">

<header>

<div style="width:50%;height:200px;float:left">

<img src="../img/logo.png" style="width:250px;height:190px;">



 </div>
<div style="width:50%;height:200px;float:left">
<img src="../img/logo2.png" style="width:250px;height:190px;">

</div>


 </header>

<nav>
<ul>

<li> <a href="../index.html">HOME </a> </li>

<li> <a href="service.html">SERVICE </a> </li>

<li> <a href="about us.html">ABOUT </a> </li>

<li> <a href="contact.html">CONTACT</a> </li>

<li> <a href="gallery.html">GALLERY</a> </li>


</ul>


</nav>



<section style="min-height:500px;margin:0">

<div style="background-color:rgb(2,173,193);width:100%;height:70px; margin:0;">
<br>
<h1 style=" color:white;margin-top:0px; margin-left:20px;"> Services |
<span style="font-size:16px" >
Take A Look What We love To  Do </span>
</h1>


 </div>


<table ">

<tr>
<td>
<img src="../img/html-5-icon.png" style="width:100px;height:100px; margin-left:120px"/>

<h3 style="text-align:center">Latest Technology</h3>
<p style="text-align:center">
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
</p>
</td>



<td>
<img src="../img/activity_grid21600.png" style="width:100px;height:100px; margin-left:120px"/>

<h3 style="text-align:center">Latest Technology</h3>
<p style="text-align:center">
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
</p>
</td>



<td>
<img src="../img/Document-icon.png" style="width:100px;height:100px; margin-left:120px"/>

<h3 style="text-align:center">Latest Technology</h3>
<p style="text-align:center">
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
</p>
</td>


</tr>







<tr>
<td>
<img src="../img/iPhone-White-Apple-icon.png" style="width:100px;height:100px; margin-left:120px"/>

<h3 style="text-align:center">Latest Technology</h3>
<p style="text-align:center">
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
</p>
</td>



<td>
<img src="../img/wheels-icon.png" style="width:100px;height:100px; margin-left:120px"/>

<h3 style="text-align:center">Latest Technology</h3>
<p style="text-align:center">
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
</p>
</td>



<td>
<img src="../img/Eye-icon.png" style="width:100px;height:100px; margin-left:120px"/>

<h3 style="text-align:center">Latest Technology</h3>
<p style="text-align:center">
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
</p>
</td>


</tr>




</table>

 </section>


<footer>
<br>


<p style="text-align:center; ">Made by : Salmanmasood </p>
</footer>




</div>


</body>
</html>

Thursday, 12 October 2017

Progress Bar in C#

  private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            int sum = 0;
            for (int i = 1; i <= 100; i++)
            {
                Thread.Sleep(100);
                sum = sum + i;
                // Calling ReportProgress() method raises ProgressChanged event
                // To this method pass the percentage of processing that is complete
                backgroundWorker1.ReportProgress(i);
                if (i == 100)
                {
                   
               
                    e.Cancel = true;
                    // Reset progress percentage to ZERO and return
                    backgroundWorker1.ReportProgress(100);
                 
                    return;

               
                 
                }

                // Check if the cancellation is requested
                if (backgroundWorker1.CancellationPending)
                {
                    // Set Cancel property of DoWorkEventArgs object to true
                    e.Cancel = true;
                    // Reset progress percentage to ZERO and return
                    backgroundWorker1.ReportProgress(0);
                    return;
                }
            }
        }

        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            progressBar1.Value = e.ProgressPercentage;
            label1.Text = e.ProgressPercentage.ToString() + "%";

        }

        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                label1.Text = "Processing cancelled";
                f.Show();


            }
            else if (e.Error != null)
            {
                label1.Text = e.Error.Message;
            }
            else
            {
                label1.Text = e.Result.ToString();
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (!backgroundWorker1.IsBusy)
            {
                // This method will start the execution asynchronously in the background
                backgroundWorker1.RunWorkerAsync();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (!backgroundWorker1.IsBusy)
            {
                // This method will start the execution asynchronously in the background
                backgroundWorker1.RunWorkerAsync();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (backgroundWorker1.IsBusy)
            {
                // Cancel the asynchronous operation if still in progress
                backgroundWorker1.CancelAsync();
            }
        }

one to many relationship in sql

create table department ( dept_id int identity primary key, dept_name nvarchar(20) not null ) insert into department values('CS') insert into department values('MATHS') insert into department values('PHYSICS') insert into department values('CHEMISTRY') insert into department values('GEOLOGY') SELECT * FROM department create table TEACHERS ( T_id int identity primary key, T_name nvarchar(20) not null ) INSERT INTO TEACHERS VALUES('SALMAN') INSERT INTO TEACHERS VALUES('ALI') INSERT INTO TEACHERS VALUES('AHSAN') INSERT INTO TEACHERS VALUES('AHMED') INSERT INTO TEACHERS VALUES('BILAL') INSERT INTO TEACHERS VALUES('ZOHAIB') INSERT INTO TEACHERS VALUES('SANA') INSERT INTO TEACHERS VALUES('KHALID') INSERT INTO TEACHERS VALUES('KHIZRA') INSERT INTO TEACHERS VALUES('SAMI') INSERT INTO TEACHERS VALUES('UZAIR') INSERT INTO TEACHERS VALUES('RAZA') INSERT INTO TEACHERS VALUES('YASIR') SELECT * FROM TEACHERS CREATE TABLE T_D_RECROD ( S_ID INT IDENTITY PRIMARY KEY, FK_T INT unique FOREIGN KEY REFERENCES TEACHERS(T_id), FK_d INT FOREIGN KEY REFERENCES department(dept_id) ) insert into T_D_RECROD values(1,1) insert into T_D_RECROD values(3,1) insert into T_D_RECROD values(5,1) insert into T_D_RECROD values(7,1) insert into T_D_RECROD values(9,1) insert into T_D_RECROD values(11,1) insert into T_D_RECROD values(2,3) insert into T_D_RECROD values(4,4) insert into T_D_RECROD values(6,2) insert into T_D_RECROD values(8,3) insert into T_D_RECROD values(12,1) select t.T_id,t.T_name,d.dept_id,d.dept_name from T_D_RECROD r inner join TEACHERS t on t.T_id=r.FK_T inner join department d on d.dept_id=r.FK_d

Wednesday, 11 October 2017

Gallery page and linking other pages

Html code:





<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>About Us</title>
<link href="../css/style.css" rel="stylesheet"  type="text/css"/>

<style>

img:hover
{ border:2px solid red;
opacity:0.4;


}

</style>
</head>

<body>

<div id="warpper">

<header>

<div style="width:50%;height:200px;float:left">

<img src="../img/logo.png" style="width:250px;height:190px;">



 </div>
<div style="width:50%;height:200px;float:left">
<img src="../img/logo2.png" style="width:250px;height:190px;">

</div>


 </header>

<nav>
<ul>

<li> <a href="../index.html">HOME </a> </li>

<li> <a href="service.html">SERVICE </a> </li>

<li> <a href="about us.html">ABOUT </a> </li>

<li> <a href="contact.html">CONTACT</a> </li>

<li> <a href="gallery.html">GALLERY</a> </li>


</ul>


</nav>



<section style=" height:auto">


<div style="width:90%;background-color:#FFF; margin:0 auto;margin-top:20px;">
<a href="../img/g1.jpg" target="new">
<img src="../img/g1.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>

</a>


<img src="../img/g2.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g3.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g4.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g5.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>

<br><br>


<img src="../img/g6.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g7.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g8.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g9.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g10.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>

<br><br>

<img src="../img/g1.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g2.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g3.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g4.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g5.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>

<br><br>


<img src="../img/g6.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g7.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g8.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g9.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>
<img src="../img/g10.jpg" width="200px" height="200px" style=" border-radius:20px 50px 20px 50px; box-shadow:5px 5px 5px 5px #0033FF"/>







</div>









 </section>

<br><br>
<footer>
<br>


<p style="text-align:center;">Made by : Salmanmasood </p>
</footer>




</div>


</body>
</html>

Contact Us form in html and styling navigation bar

html  code:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>About Us</title>
<link href="../css/style.css" rel="stylesheet"  type="text/css"/> 



<script
src="http://maps.googleapis.com/maps/api/js">
</script>
<script>
function initialize() {
  var mapProp = {
    center:new google.maps.LatLng(24.9273208  , 67.0330662),
    zoom:15,
    mapTypeId:google.maps.MapTypeId.ROADMAP
  };
  var map=new google.maps.Map(document.getElementById("maps"), mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />







<style>

#maps
{ background-color:#666;
width:70%;
height:500px;
float:left;
}
#forms
{background-color:#093;
width:30%;
height:500px;
float:left;
color:#fff;
}

form
{

width: 100%;
height:100%;
background-color:rgb(2,173,193);
font-style:italic;
font-weight:bold;


}
TD{
 padding:20PX;}








 </style>


</head>

<body>

<div id="warpper"> 

<header>

<div style="width:50%;height:200px;float:left">

<img src="../img/logo.png" style="width:250px;height:190px;">



 </div>
<div style="width:50%;height:200px;float:left"> 
<img src="../img/logo2.png" style="width:250px;height:190px;">

</div>


 </header>

<nav> 
<ul> 

<li> <a href="../index.html">HOME </a> </li>

<li> <a href="service.html">SERVICE </a> </li>

<li> <a href="about us.html">ABOUT </a> </li>

<li> <a href="contact.html">CONTACT</a> </li>

<li> <a href="gallery.html">GALLERY</a> </li>


</ul>


</nav>



<section style="min-height:500px;background-color:red">

<div id="forms">


<form>
<br>
<br>

<table>

<tr> 
<td> User Name: </td>

<td>
<input type="text" size="15"  required="required" maxlength="10"/>

 </td>
 </tr>

<tr> 
<td> Password: </td>
<td> <input type="password" size="15"  required="required"/>  </td>
 </tr>


<tr> 
<td> Gender: </td>
<td>
<input type="radio"value="male" name="gender"/>Male <input type="radio" value="Female" name="gender"/>Female
 </td>

 </tr>


<tr>

<td>Education </td>
<td>
<input type="checkbox"  name="EDU" value="SSC"/>SSC
<input type="checkbox"  name="EDU" value="HSC"/>HSC
<input type="checkbox"  name="EDU" value="GRADUATION"/>GRAD
   </td>

</tr>




<TR>

<TD> City: </TD>
<TD>
<select>
<option value="khi">Karachi</option>
<option value="lhr">Lahore</option>
<option value="isb">Islamabad</option>
<option value="MUL">Multan </option>

</select>

</TD>

</TR>

<tr>

<td>Upload Resume: </td>
<td> <input type="file"/>  </td>

</tr>


<tr>

<td> </td>
<td><button> Submit!</button> </td>

</tr>


</table>



</form>




 </div>

<div id="maps">

<iframe width="450px" height="450px" src="https://www.google.com/maps/place/Aptech+Computer+Education+North+Karachi+Center/@24.9787237,67.0596737,17z/data=!3m1!4b1!4m5!3m4!1s0x3eb340e584b891c3:0x29b2cbc198ba2dbd!8m2!3d24.9787237!4d67.0618624"> </iframe> 




 </div>



 </section>


<footer> 
<br>


<p style="text-align:center; ">Made by : Salmanmasood </p>
</footer>




</div>


</body>
</html>

Monday, 9 October 2017

compete layout of a web page using html and css

html code:


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cloud Tech</title>
<link href="css/style.css" rel="stylesheet"  type="text/css"/> 
</head>

<body>

<div id="warpper"> 

<header>

<div style="width:50%;height:200px;float:left">

<img src="img/logo.png" style="width:250px;height:190px;">



 </div>
<div style="width:50%;height:200px;float:left"> 
<img src="img/logo2.png" style="width:250px;height:190px;">

</div>


 </header>

<nav> 
<ul> 

<li> <a href="#">HOME </a> </li>

<li> <a href="#">SERVICE </a> </li>

<li> <a href="#">ABOUT </a> </li>

<li> <a href="#">CONTACT</a> </li>


</ul>


</nav>



<section>

<h3 style="color:rgb(2,173,193); font-style:normal; font-weight:normal ; text-align:center" >Welcome Ethones! </h3>

<blockquote>

<p style=" text-align:justify">Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document. </p>

</blockquote>



<div style=" width:95%;height:200px;margin:0 auto;"> 

<img src="img/1.jpg" style="width:33%;height:200px"/>
<img src="img/2.jpg" style="width:33%;height:200px"/>
<img src="img/3.jpg" style="width:33%;height:200px"/>
 
</div>

<blockquote>

<p style=" text-align:justify">

Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
Video provides a powerful way to help you prove your point. When you click Online Video, you can paste in the embed code for the video you want to add. You can also type a keyword to search online for the video that best fits your document.
To make your document look professionally produced, Word provides header, footer, cover page, and text box designs that complement each other. For example, you can add a matching cover page, header, and sidebar. Click Insert and then choose the elements you want from the different galleries.
Themes and styles also help keep your document coordinated. When you click Design and choose a new Theme, the pictures, charts, and SmartArt graphics change to match your new theme. When you apply styles, your headings change to match the new theme.

</p>
</blockquote>



<h2>Template Customization</h2>

<p> To make your document look professionally produced, <a href="#" style="color:#F6C">Word provides</a> header, footer, cover page, and text box designs that complement each other. For example, you can add a matching cover page, header, and sidebar. Click Insert and then choose the elements you want from the different galleries.
Themes and styles also help keep your document coordinated. When you click Design and choose a new Theme, the pictures, charts, and SmartArt graphics change to match your new theme. When you apply styles, your headings change to match the new theme.</p>

<h3 style="color:#903"> Our Blog</h3>
<p> text box designs that complement each other. For example, you can add a matching cover page, header, and sidebar. Click Insert and then choose the elements you want from the different galleries.
Themes and styles also help keep your document coordinated. When you click Design and choose a new Theme, the pictures, charts, and SmartArt graphics change to match your new theme. When you apply styles, your headings change to match the new theme.</p>

 </section>


<footer> 
<br>


<p style="text-align:center; ">Made by : Salmanmasood </p>
</footer>




</div>


</body>
</html>

css code:

@charset "utf-8";
/* CSS Document */
body
{ margin:0 auto;
padding:0px;
}
#warpper
{
width:100%;
height:auto;

}
header
{
width:100%;
height:200px;
background-color:rgb(2,173,193);
hsl:(124,235,92);

}
NAV
{
width:100%;
height:50px;
background-color:rgb(255,190,0);
}

nav ul
{ list-style-type:none;
margin:0;

}
nav ul li
display:inline-block;
margin-top:20px;

}
nav ul li a
{
color:#333;
font-weight:bold;
padding:20px;
text-decoration:none;
}

section p
{ font-family:"Courier New", Courier, monospace;
color:#999;
 
}


section
{
width:100%;
height:auto;
background-color:#fff;

}
footer
{
width:100%;
height:50px;
background-color:rgb(255,190,0);

}

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...