Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
A simple piece of code can force the checkboxes in a ListView control to behave like radio buttons. Set the ListView
One of the most common things VB programmers do with Excel is load data into an Excel worksheet from a Recordset object. The method I see used most often to
Use this function to read a number decimal symbol from regional settings: Sub Form_Load()Dim DecS As StringDecS = ReadDecimalSymbol()End SubFunction ReadDecimalSymbol() As StringReadDecimalSymbol = Mid$(CStr(1.1), 2, 1)End Function
This routine takes a passed filename as an argument and generates a description for it. It returns the same string as Windows Explorer does when it has been set to
This tip will trim the contents in the input box of an HTML page using java script. Call the Trim function by sending the Textbox element as the parameter. Example:
If you come across a situation where you need to prompt the user to download an XML file with
You might have a table with different PEOs for each Company ID. For example: Table name : tblRankingCid peo———– ———–1 200003311 200006301 200009301 200012312 200003312 200006302 200009302 20001231 To give
This is a SQL trick for spreading out data across months on a single row. It also works with Sybase TSQL. The 1-ABS(SIGN()) function will evaluate to zero for all
The JavaScript Array intrinsic object (and others) can be extended to include user-defined functions in the object definition. These extensions can be placed in a .js file and included in
C++ smart pointers are the idea of using a selector to access a class. This gives the class writer an option to control access to class members and function. For
Creating dynamic Microsoft documents may be useful. The problem is that creating Word documents in ASP will result in an error saying that IIS cannot run out of process components.
This code shows how to get value from the control irrespective of the control type used in the client side Javascript. function GetValue(ControlName,FormName){var Control=document.forms[FormName].elements[ControlName]alert(Control.type) switch(Control.type) { case “select-one”: case “select-multiple”:
Using Count(*) is generally better than using Count() with a specific column name, because it gives the query engine the flexibility to find out the row count any way it
You can make a privately inherited member public by specifying its access modifier in the derived class. For example: #include class base{ public: int a; int b; base() { a=10;
When initializing parameters in a constructor, the order of initialization will not be the same as the order in which you typed them. The order of initializing parameters is ‘as
The Java 2 Runtime Environment is the minimum standard Java computing environment for running applications written in the Java programming language. It contains the Java virtual machine, Java core classes,
This tip demonstrates a user interaction (mouse move & mouse click) using native Robot methods.Here’s the algorithm of the program:1. Quickly to move the mouse cursor to the upper left
Merlin (JDK1.4) introduces two new features: JSpinner and MouseWheelListener. Sometimes it is convenient to control the spinner values with the mouse wheel. Here’s an example: import javax.swing.*;import java.awt.event.*;public class TestSpinner
Sometimes you want to create a thread to run something trivial, like when you’re debugging your code. This is a quick way to do it: new Thread(new Runnable() { public
Recently, I found I needed to send e-mail from my program. Because I did not want to create any external dependencies, I decided not to use JavaMail. However, I wanted
This application shows the percentage of the used CPU for any Windows system with up to 32 processors. The code that deals with the API to request the CPU information
The DBList and DBCombo controls expose a MatchEntry property, that – when set to True – permits to perform quick incremental searches by simply typing the searched sequence of characters.
Apart from the different kind of combo boxes you can obtain by manipulating the Style property, another feature is made available by Windows when dealing with combo box controls, the
The only way for a Tab key to insert a tab character in a multiline text box is that the text box is the only control on the form, or
Most MsDos programs used the Enter key to move from one field to the next one. You can easily simulate this behavior by setting the form’s KeyPreview property to True
Many Windows programs use two adjacent list box controls to let the user select a number of items from a list of available values; such list boxes are mutually exclusive,
In all standard controls, Up and Down arrow keys move the focus on the previous or next control in the TabIndex order, respectively. This contrasts with text boxes, where these
Option ExplicitPrivate Declare Function CreateFile Lib “kernel32” Alias “CreateFileA” (ByVal _ lpFileName As String, ByVal dwDesiredAccess As Long, _ ByVal dwShareMode As Long, lpSecurityAttributes As Any, _ ByVal dwCreationDisposition As
Many code wizards and automated source code generators synthesize the following main() template, even if the application doesn’t use command line arguments: int main(int argc, char* argv[]){ return 0;} This
The constructors in a class hierarchy execute in the following sequence: base class constructors are called first, then member object’s constructors, and finally, the constructor of the derived class executes.











