Tip Bank

DevX - Software Development Resource

Measuring a string drawn with a specific font

When you’re dynamically drawing text (either on a Windows Form or Web Form application), you may need to calculate the width and height of a string printed with a particular

DevX - Software Development Resource

Linking a file in Visual Studio .NET

If in VS.NET you add to the current project an existing file that’s located outside the current project’s directory, the file is first copied in the project’s directory, and then

DevX - Software Development Resource

Disable the Alt+F4 Key Combination to Keep the Window from Closing

Assume you have an MFC application. The solution is to override the virtual function: virtual BOOL CWinApp::ProcessMessageFilter(int code, LPMSG lpMsg); The following code demonstrates: BOOL CMyProgramApp::ProcessMessageFilter(int code, LPMSG lpMsg){ if(WM_SYSKEYDOWN

DevX - Software Development Resource

Using the JEditorPane to Display HTML File

The JEditorPane provides a mechanism through which you can add support for custom text formats. A standard editor pane can understand plain text, HTML, and RTF. import javax.swing.*;import javax.swing.event.*;import java.awt.*;import

DevX - Software Development Resource

Relative Urls in user controls

Urls that you set in user-control’s child controls are relative to the user control’s directory, not to the host page’s directory. Say for example that you have an user-control located

DevX - Software Development Resource

Creating a popup calendar control

Many data entry forms have one or more text fields that the user should fill with a date value. Many sites have a button near these fields that when clicked