Archive for September, 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

Testing for Programmers - Beginners

My new article Testing for Beginners available on CodeProject.
This article provides basic information about software testing for programmers in a beginner’s level.
Explain in detail about subject - testing is out of scope of this article. Just a simple Google search can give you more than enough results. So I wrote this article with [...]

Leave a Comment

Microsoft XNA - Quick sample

This is a quick sample which demonstates the loading of texture and output of a string.

No worries, 99% of the code is already supplied by Visual Studio

#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
#endregion
namespace WindowsGame1
{
public class Game1 : Microsoft.Xna.Framework.Game
{
[...]

Leave a Comment

Change attributes of items in a combobox

This was an expiriment program for changing fonts, colors, draw shapes etc.
To alter the items, you need to use comboBox1.DrawMode

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
[...]

Leave a Comment

Move a control with mouse on form

This is a simple script which demonstates how to move a control (here I used button) by dragging it (without using builtin drag-drop features ;))

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
private int [...]

Leave a Comment