devxlogo

Tip Bank

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

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

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

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

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

Disabling the session state to improve performances

Sessions management consumes server’s resources and memory, thus, if you don’t use them in your application, you should disable them to improve performances. You can disable sessions for the entire