A sample application is available under the directory Samples\VC#.NET 2003 inside the directory used to install the SDK on you PC (default C:\Program Files\3D Button API\samples\VC#.NET 2003)

Here follow the steps required to adapt an application to the use of the API:

Copy in your project directory the module file 3dbapi.cs that you can find in C:\Program Files\3D Button API\include and add it to your project; this file contains all the namespaces and classes needed in order to let your application use the 3dbapi.dll library.

The operations that follow must be executed for every Form inside your application.

Open your Form code, in which we suppose to have one Push Button named button1, one Check Box named checkbox1 and two Radio Buttons named radioButton1 and radioButton2 and add the following lines of code at the beginning of the file:

using abmApi;

Inside the Form class declaration change the following lines:

private System.Windows.Forms.Button button1;

private System.Windows.Forms.CheckBox checkBox1;

private System.Windows.Forms.GroupBox groupBox1;

private System.Windows.Forms.RadioButton radioButton1;

private System.Windows.Forms.RadioButton radioButton2;

With the following lines:

private abmApi.abmPushButton button1;

private abmApi.abmCheckBox checkBox1;

private System.Windows.Forms.GroupBox groupBox1;

private abmApi.abmRadioButton radioButton1;

private abmApi.abmRadioButton radioButton2;

As you can see we have changed the button classes using three classes (abmPushButton, abmCheckBox and abmRadioButton declared inside the abmApinamespace in 3dbapi.cs) that inherit from the standard buttons classes.

Expand the section named "Windows Form Designer generated code" and change the following lines inside the InitializeComponent function:

this.button1 = new System.Windows.Forms.Button();

this.checkBox1 = new System.Windows.Forms.CheckBox();

this.groupBox1 = new System.Windows.Forms.GroupBox();

this.radioButton1 = new System.Windows.Forms.RadioButton();

this.radioButton2 = new System.Windows.Forms.RadioButton();

With the following lines:

this.button1 = new abmApi.abmButton();

this.checkBox1 = new abmApi.abmCheckBox();

this.groupBox1 = new System.Windows.Forms.GroupBox();

this.radioButton1 = new abmApi.abmRadioButton();

this.radioButton2 = new abmApi.abmRadioButton();

Override the Load event and add the following line of code to the Form_Load function:

abmApiClass.abmContainerSubclass (this.Handle.ToInt32());

This will cause your Form HWND to be added to a list of windows subclassed by the API.

Now you must subclass every button inside the form, so do the following: