Archive for September 26th, 2007

Reverse text as you type

Time pass

public string Reverse(string x)
{
char[] charArray = new char[x.Length];
int len = x.Length - 1;
for (int i = 0; i < = len; i++)
charArray[i] = x[len-i];
return new string(charArray);
}
private void txtBox1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
textBox2.Text = Reverse(textBox1.Text);
}

VN:F [1.1.6_502]Rating: 0.0/5 (0 votes cast)

Leave a Comment

Reorder listbox items with JavaScript and ASP.NET

Default.aspx:

< %@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" ValidateRequest="false" %>
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

#lstWishList {
background-color:lightgrey;
font:10px notmal arial;
overflow:visible;;
}
#divNumbers {
font:10px notmal arial;
line-height:13px;
}
.imgbutton {
cursor:pointer;
}

function LoadNumbers() {
lst = document.getElementById(”lstWishList”);
lst.size = lst.options.length;
lstNumbers = document.getElementById(”lstWishListNumbers”);
div = document.getElementById(”divNumbers”);
s = “”;
for (i=1;i

Leave a Comment