Pages

Beginning Visual C# 2010

this is agreat book about  Beginning Visual C# 2010
download here

c# code || to make a password form

After drag and drop "group box" , "2 button" , "2 text box" and "2 label"
It was organized as the image


we will write this code in button"enter " then run

if (textBox1.Text == "mohamed" && textBox2.Text == "1")
{
form2 airline=new form2();
airline.show();
this.hide();
}
else if (textBox1.Text != "mohamed" && textBox2.Text != "1")
{
MessageBox.Show("enter true name or password", "error");
}

// with my best: mohamed basha

c# code || to make a timer on form

After drag and drop "timer and label" write this code on timer

DateTime mytime = DateTime.Now;



label1.Text = Convert.ToString(mytime);
 
 
//with my best :mohamed basha
<script type="text/javascript">


<!--

/* Background fade */



function BgFade(red1, grn1, blu1, red2, grn2, blu2, steps)

{

sred = red1; sgrn = grn1; sblu = blu1;

ered = red2; egrn = grn2; eblu = blu2;

inc = steps;

step = 0;

RunFader();

}



function ToHex(d)

{

return (d-0).toString(16);

}

function RunFader()
var epct = step/inc;
var spct = 1 - epct;
var clrRed = Math.floor(sred * spct + ered * epct);

var clrGreen = Math.floor(sgrn * spct + egrn * epct);

var clrBlue = Math.floor(sblu * spct + eblu * epct);

document.body.style.background = "#"+ ToHex(clrRed) + ToHex(clrGreen) + ToHex(clrBlue);

if ( step < inc )

{

setTimeout('RunFader()',50);

}

step++;

}

BgFade(0x00,0x00,0x00, 0xFF,0xFF,0xFF,10);

//-->

</script>


                                             with my best :: mohamed basha

 
This code to make Flying Letters
 
<div style="color:#000000;font-family:Arial;font-size:16px;font-weight:bold;font-style:normal;text-decoration:none" id="Fly">http://java2site.blogspot.com</div>
<script type="text/javascript">
// Configure message to display. Use "$" for linebreak
// By default, set to just grab the text from element with ID="fly"
message = document.getElementById("Fly").innerHTML; // $ = taking a new line
distance = 50;
speed = 200;
var txt="",
num=0,
num4=0,
flyofle="",
flyofwi="",
flyofto="",
fly=document.getElementById("Fly");
function stfly()
{
for(i=0;i != message.length;i++)
{
if(message.charAt(i) != "$")
txt += "<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"<\/span>";
else
txt += "<br>";
}
fly.innerHTML = txt;
txt = "";
flyofle = fly.offsetLeft;
flyofwi = fly.offsetWidth;
flyofto = fly.offsetTop;
fly2b();
}
function fly2b()
{
if(num4 != message.length)
{
if(message.charAt(num4) != "$")
{
var then = document.getElementById("n" + num4);
then.style.left = (flyofle - then.offsetLeft + flyofwi / 2) + "px";
then.style.top = (flyofto - then.offsetTop + distance) + "px";;
fly3(then.id, parseInt(then.style.left), parseInt(then.style.left) / 5, parseInt(then.style.top), parseInt(then.style.top) / 5);
}
num4++;
setTimeout("fly2b()", speed);
}
}
function fly3(target,lef2,num2,top2,num3)
{
if((Math.floor(top2) != 0 && Math.floor(top2) != -1)
(Math.floor(lef2) != 0 && Math.floor(lef2) != -1))
{
if(lef2 >= 0)
lef2 -= num2;
else
lef2 += num2 * -1;
if(Math.floor(lef2) != -1)
{
document.getElementById(target).style.visibility = "visible";
document.getElementById(target).style.left = Math.floor(lef2) + "px";
}
else
{
document.getElementById(target).style.visibility = "visible";
document.getElementById(target).style.left = Math.floor(lef2 + 1) + "px";
}
if(lef2 >= 0)
top2 -= num3;
else
top2 += num3 * -1;
if(Math.floor(top2) != -1)
document.getElementById(target).style.top = Math.floor(top2) + "px";
else
document.getElementById(target).style.top = Math.floor(top2 + 1) + "px";
setTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50);
}
}
stfly();
</script>


                            mohamed basha

this code to make cursor mouse text

<div style="position:absolute;width:100;height:15;color:#800080;font-size:14px;font-family:Arial;font-weight:bold;font-style:normal;text-decoration:underline" id="cursortext">java code</div>
<script type="text/javascript" language="JavaScript">
function cursorInit()
{
document.onmousemove = onMouseMove;
}
function onMouseMove(e)
{
if (!e)
var e = window.event
window.Event;
if ('undefined' != typeof e.pageX)
{
x = e.pageX;
y = e.pageY;
}
else
{
x = e.clientX + document.body.scrollLeft;
y = e.clientY + document.body.scrollTop;
}
x += 13;
y += 7;
document.getElementById('cursortext').style.left = x + "px";
document.getElementById('cursortext').style.top = y + "px";
}
onload = cursorInit;
</script>
 
 
                                



 this is code to blinking text

<script type="text/javascript">

//*********************************************

//* Use the script freely as long as this *
//* message is intact *
//*********************************************
window.onerror = null;
var IE4=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var NS4=document.layers;
var NS6=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
var blink_speed=120; // Delay in milliseconds
var i=0;
var left_pos=330; // The Distance of text from left
if (IE4)
{
layerRef="document.all";

styleSwitch=".style";
}
function Blink(layerName)
{
if (IE4)
{
if(i%2==0)
{
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="visible"');
}
else
{
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="hidden"');
}
}
if(NS6 && (navigator.appName!="Microsoft Internet Explorer"))
{
if(i%2==0)
{
eval('document.getElementById("' + layerName + '").style.display=""');
}
else
{
eval('document.getElementById("' + layerName + '").style.display="none"');
}
}
if(i<1)
{
i++;
}
else
{
i--;
}
setTimeout("Blink('"+layerName+"')", blink_speed);
}
if(IE4
NS6)
{
if(IE4)
{
dispIENS="visibility:hidden;";
}
else
{
dispIENS="display:none;";
}
document.write('<div id="wb_blink" style="' + dispIENS + '"><font style="font-size:14px;font-family:Arial;font-weight:bold;font-style:normal;text-decoration:none" color="#800080">mohamed basha</font></div>');
Blink('wb_blink');
}
if(NS4)
{
document.write('<blink><font face="Arial" size=14 color="#800080">mohamed basha</font></blink>');
}
</SCRIPT>


with my best         mohamed basha





this code for basic date

<div style="color:#FF0000;font-size:16px;font-family:Arial;font-weight:bold;font-style:normal;text-decoration:underline" id="basicdate"></div>

<script type="text/javascript">

var now = new Date();

var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

var date = ((now.getDate() < 10) ? "0" : "") + now.getDate();

var year = (now.getYear() < 1000) ? now.getYear() + 1900 : now.getYear();

today = days[now.getDay()] + ", " + months[now.getMonth()] + " " + date + ", " + year;

var basicdate = document.getElementById('basicdate');

basicdate.innerHTML = today;

</script>






                                                     mohamed basha

basic clock


this code for a time basic clock

<div style="color:#FF0000;font-size:12px;font-family:Arial;font-weight:normal;font-style:normal;text-decoration:none" id="basicclock"></div>



<script type="text/javascript">

function clock()

{

var digital = new Date();

var hours = digital.getHours();

var minutes = digital.getMinutes();

var seconds = digital.getSeconds();

if (minutes <= 9) minutes = "0" + minutes;

if (seconds <= 9) seconds = "0" + seconds;

dispTime = hours + ":" + minutes + ":" + seconds;



var basicclock = document.getElementById('basicclock');

basicclock.innerHTML = dispTime;

setTimeout("clock()", 1000);

}

clock();

</script>



                                                              mohamed basha 

Link With in

Related Posts Plugin for WordPress, Blogger...