Custom Search

December 29, 2008

Div Panels

Hello folks. If you're searching for the div panel source codes, you won't be disappointed in this page.

Here are some samples of div panels:



Standard Div Panel

Source code:
<div style="border: 1px solid blue; height: 100px;">
Put your content here...
</div>
Sample Result:

Put your content here...

Top


Scrollable Div Panel (Vertical)

Source code:
<div style="border: 1px solid blue; height: 100px; overflow-y: scroll;">
Put your content here...
</div>
Sample Result:

Put your content here...
Put your content here...
Put your content here...
Put your content here...

Top


Scrollable Div Panel (Horizontal)

Source code:
<div style="border: 1px solid blue; overflow-x: scroll; background-color: rgb(238, 238, 238); width: 400px; white-space: nowrap;">
Put your content here....
</div>
Sample Result:

Put your content here....
Put your content here....
Put your content here....

Top

December 27, 2008

C# Interface usage

This is how to create an interface.

public interface IPerson {
string Firstname {get;set;}
string Lastname {get;set;}
DateTime BirthDate {get;set;}
DateTime GetCurrentAge();
}


There are two ways to implement the interface you've created. It is either you implement it implicitly and or you implement it explicitly.

This is how to implement it Implicitly.

public class Engineer : IPerson {
public string firsname;
public string lastname;
public DateTime birthDate;

public Engineer(string _firstname, string _lastname, DateTime _birthdate){
Firstname = _firsname;
Lastname = _lastname;
BirthDate = _birthdate;
}

public string Firstname {
get { return firstname; }
set { firsname = value; }
}

public string Lastname {
get { return lastname; }
set { lastname = value; }
}

public DateTime BirthDate {
get { return birthDate; }
set { birthDate = value; }
}

public DateTime GetCurrentAge () {
return DateTime.Now.Subtract(BirthDate);
}

}

This is how to implement it Explicitly.

public class Engineer : IPerson {
public string firsname;
public string lastname;
public DateTime birthDate;

public Engineer(string _firstname, string _lastname, DateTime _birthdate){
Firstname = _firsname;
Lastname = _lastname;
BirthDate = _birthdate;
}

IPerson.string Firstname {
get { return firstname; }
set { firsname = value; }
}

IPerson.string Lastname {
get { return lastname; }
set { lastname = value; }
}

IPerson.DateTime BirthDate {
get { return birthDate; }
set { birthDate = value; }
}

IPerson.DateTime GetCurrentAge () {
return DateTime.Now.Subtract(BirthDate);
}

}