Featured Posts

C#, WPF

How to Text Wrap a Label in WPF?

WPF does not allow text wrapping for label control.Thus to wrap a label with a fixed width,we have to place the TextBlock control inside the label control and set its TextWrapping property to “Wrap”.

<Label Width=”50″>
<TextBlock TextWrapping=”Wrap”> I am label with width 50</TextBlock>
</Label>

Popularity: 1% [?]

How-to, Internet, Tech Stuff, Uncategorized

How to create an OpenID and use it ?

openid-logo

OpenID

Fed up with creating new accounts for multiple websites, here comes OpenID for the rescue. It allows you to use an existing account to sign in to multiple websites without ’sign up’. OpenID replaces the common login process that uses a login name and password for every website.

An OpenID is in the form of a unique URL (e.g., http:\\me.yahoo.com\testid), which is authenticated by the user’s OpenID provider. Some of the websites who supports, allows and provides OpenID are Yahoo, Google, ZOHO, Microsoft, AOL, PayPal, Verisign. The OpenID doesn’t rely on a central authority to authenticate the user. The OpenID protocol leaves the type of authentication to the provider, the authentication forms may include passwords and biometrics.

Let us create a OpenID with Yahoo!

  1. Go to Yahoo OpenID website Yahoo! OpenID
  2. Get Started, login with your Yahoo ID

    Yahoo! OpenID

    Yahoo! OpenID

  3. Now Yahoo will display the OpenID URL (identifier) generated for you

    OpenID generated

    OpenID generated

  4. To create custom identifier click on ‘Show customization Options‘. Check for available identifiers, Yahoo recomends not to use mail id as part of the openID as it may expose our mail id. click on ‘Save My Customization‘.

    Custom OpenID

    Custom OpenID

Let us check how to use the OpenID.

  1. Go to Live Journal, click on ‘Login with OpenID‘ in the login page to open the OpenID login page.livejournal-openid-login
  2. Enter your OpenID and click Login (I don’t have account in Live Journal)
  3. This will forward it to Yahoo, where you need to login with Yahoo ID
  4. Now you have logged into Live Journal using OpenID.

The major advantage of an OpenID is you need not create a new account for every website you visit, instead create an OpenID and use the same account to log into all websites you visit.

Popularity: 5% [?]

C#

How to set border color of a panel in c#

In c# for panel there no property to set border color directly.We can only set the border style using BorderStyle.

To set the border color of a panel,

Step 1 : Set BorderStyle property to None.

Step 2 : Draw a rectangle and set the pen color in paint event of the panel

private void panelpanelbordercolor1_Paint(object sender, PaintEventArgs e)
{
  e.Graphics.DrawRectangle(Pens.Red,
  e.ClipRectangle.Left,
  e.ClipRectangle.Top,
  e.ClipRectangle.Width - 1,
  e.ClipRectangle.Height -1);
  base.OnPaint(e);
}

Source Link

Popularity: 3% [?]

Java

How to convert from .class file to .java file in Java

Step 1: Download Java – Decompiler from

http://download.cnet.com/windows/3055-2213_4-10046809.html?tag=pdl-redir

Step 2: Install the Java – Decompiler in your PC.

Step 3: Go to All Programs –> DJ Java Decomplier –> DJ Java Decomplier.

Step 4: Select File –> Open then Choose the Class File in File Dialog box.

djopendialogjpg

Step 5: Java File is created from class File.

javafilejpg

Popularity: 4% [?]

C#, WPF

How To Call a Button Click From Another Button in c#

If there is a requirement for calling a button click event from another button in c#, there is a easy way to do.We just need to call the PerformClick Method of the button to be fired.

private void button1_Click(object sender, EventArgs e)
{
    button2.PerformClick();
}
 
private void button2_Click(object sender, EventArgs e)
{
    System.Windows.Forms.MessageBox.Show("I am called from button1");
}

Popularity: 4% [?]

Java

Java 1.5 features

  • Generics: provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion).
  • Metadata: also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities.
  • Autoboxing/unboxing: automatic conversions between primitive types (such as int) and primitive wrapper classes (such as integer).
  • Enumerations: the enum keyword creates a typesafe, ordered list of values (such as day.monday, day.tuesday, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern).
  • Swing: new skinnable look and feel, called synth.
  • Var args: the last parameter of a method can now be declared using a type name followed by three dots (e.g. Void drawtext(string… Lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type.
  • Enhanced for each loop: the for loop syntax is extended with special syntax for iterating over each member of either an array or any iterable, such as the standard collection classesfix the previously broken semantics of the java memory model, which defines how threads interact through memory.
  • Automatic stub generation for rmi objects.
  • Static imports concurrency utilities in package java.util.concurrent.
  • Scanner class for parsing data from various input streams and buffers.
  • Assertions
  • StringBuilder class (in java.lang package)

Popularity: 3% [?]

ActionScript 2, ActionScript 3, Flash

How to Get the Base URL in Flash ActionScript 2 and ActionScript 3?

Step 1

Create a flash project and set the Publish Settings’ ActionScript version as 2.

Step 2

Create two dynamic texts, named as txtFullUrl and txtBaseUrl.

baseurl01

Step 3

Create another layer; in first frame of that layer write the following ActionScript code.

Action Script 2 Code

baseurl02

function GetTheBaseUrl() {
var RootFullUrl = _root._url;
txtFullUrl.text = RootFullUrl;
var lastSlashIndex:Number = RootFullUrl.lastIndexOf("/");
var DriveIndex:Number = RootFullUrl.indexOf("|");
 
if (DriveIndex>=0) {
baseUrl = RootFullUrl.substring(0, DriveIndex);
baseUrl += ":";
} else {
baseUrl = "";
}
baseUrl += RootFullUrl.substring(DriveIndex+1, lastSlashIndex+1);
txtBaseUrl.text = baseUrl;
return baseUrl;
}
 
var BaseURL:String= GetTheBaseUrl();

Action Script 3 Code

baseurl03

txtFullUrl.text = this.loaderInfo.url;
 
var FullUrl:String = this.root.loaderInfo.url;
var lastSlashIndex:Number = FullUrl.lastIndexOf("/");
var DriveSepIndex:Number = FullUrl.indexOf("|");
 
var baseUrl:String;
if (DriveSepIndex >= 0) {
baseUrl = FullUrl.substring(0, DriveSepIndex);
baseUrl += ":";
} else {
baseUrl = "";
}
baseUrl += FullUrl.substring(DriveSepIndex + 1, lastSlashIndex + 1);
txtBaseUrl.text = baseUrl;

Step 4

Press Ctrl + Enter to run the application.

Popularity: 1% [?]

Internet, Tech Stuff

6 Useful WebTools For Designers

COLOR PALETTE
To create a clean website, color plays a major role.  Selecting the color scheme for your site is made simple by introduction of many tools; you can use the color blender online tool to select your color scheme.
To select the color scheme go to www.colorblender.com and click on the first color box. Change its color by using the RGB sliders below. It will generate 6 color matching palette for the selected color. It also allows you to change all 6 color palette manually by selecting the ‘Direct Edit’ radio button.

colorblender

CSS GENERATOR
Cascading style sheets forms an integral part of the web designing. Use the web tool available in csscreator.com [ link to : http://csscreator.com/tools/cssgenerate] to create style sheets for the HTML elements. Set the properties and click on ‘Generate CSS’.

cssgenerator

LOADING IMAGE GENERATOR
Generating “loading” gif images made easy with the web tool www.ajaxload.info.
To generate specify the “loading” image type, background color, foreground color and transparency and click “Generate It!”

ajaxload_info

ICON FINDER
It’s (www.iconfinder.net )an icon directory, where you can search for icons just as you google, filter it by its sizes and background color.

icon_finder

FAVICON GENERATOR
Use the web tool www.favicon.cc you can generate the favicon. Either import an image or design your own favicon by using tools available.

favicon_generator

WEB 2.0 BUTTON GENERATOR
Go to www.mycoolbutton.com to create free buttons. Generate free icons of your style and need.

mycoolbutton

Popularity: 12% [?]

C#, WPF

Make Textbox Number Only - WPF

Coding :

private void txt_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
e.Handled = !ValidNumeric(e.Text);
base.OnPreviewTextInput(e);
}
 
bool ValidNumeric(string str)
{
bool ret = true;
 
int l = str.Length;
for (int i = 0; i &lt; l; i++)
{
char ch = str[i];
ret &= Char.IsDigit(ch);
}
 
return ret;
}

Thanks dedjo

Popularity: 1% [?]

Internet, Tech Stuff

Search Icons for web designing - Icon Finder

Icon Finder is  a place where there are huge collections of icons for web designing.

logo-large

Features :-

  • Collections of  107,536 icons
  • Browse 186 icons sets
  • Icons can be downloaded in “png” or “ico”  format.
  • We can search for icons with different sizes and background colors

Popularity: 2% [?]

 Page 1 of 12  1  2  3  4  5 » ...  Last »