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: 22% [?]

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: 7% [?]

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: 12% [?]

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: 17% [?]

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: 27% [?]

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: 9% [?]

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 < l; i++)
{
char ch = str[i];
ret &= Char.IsDigit(ch);
}
 
return ret;
}

Thanks dedjo

Popularity: 9% [?]

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: 3% [?]

How to open Immediate Window In VS 2005- Shortcuts

The Immediate window is used to debug and evaluate expressions, execute statements, print variable values etc.The Immediate window also supports IntelliSense.There are different methods to open Immediate window.

Method 1 : -
We can open Immediate Window from debug menu.

Debug->Windows->Immediate Window

immediate

Some times Immediate Window menu would be missing.If it seems to be missing for you then you can get the Immediate Window menu by going to Tools->Customize and then select the Commands tab, choose for Debug commands and drag Immediate onto the toolbar.Read more about this issue here.

Method 2 : -

Use the Keyboard Shortcut keys Ctrl+Alt+I

Method 3 : -
We can also open Immediate Window through VS Command window.Just type “immed” in the prompt and hit enter Immediate Window will open.

commimmed

For more details about Immediate Window go to MSDN Link

Popularity: 9% [?]

Easy Trick To Search for Attachments in Gmail – has:attachment

When there are hundreds of mail in our Gmail account and we are in need of mails with attachment and want it to find quickly.Then there is a easy trick in Gmail.

has:attachment

has:attachment

just type has:attachment and the type of the file like pdf,ppt,doc,zip with a space.

Example :-

has:attachment pdf

When we click the search mail button we get the mails with the attachment of the type we specified as the result.Here in this example we get the PDF attachment mails as result.

There are also many easy tricks to find a specified mail in gmail like “has:attachment” keyword.You can find the list here.

Popularity: 3% [?]

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars