eXButton - FAQ
Exontrol.COM Software - Frequently Asked Questions - ExButton Component
1:
The control's release notes can be found on our web site, looking for the Release Notes column in the control's main page. Click here for direct link.
2:
Actually, replacing old VB Command buttons with the Exontrol's exButton component is just like replacing a string with another.  

You have the following options to replace the VB Command objects with the Exontrol's exButton component.

A) 

  • Make the first step to add the ExButton to the VB project like any control with the project open (Ctrl+T), save and close it.
  • Do the "VB.Command" search and replace in each frm file.

B)

  • Open the Project1.vbp and add a reference to the exbutton.dll by adding the line ~Object={65D9132C-B295-42A0-8421-B8B1DA27C5CE}#1.0#0; ExButton.dll~ Do not include the ~ characters.
  • Open the Form1.frm and add the ~Object = "{65D9132C-B295-42A0-8421-B8B1DA27C5CE}#1.0#0"; "ExButton.dll"~ reference to the form just before 'Begin VB.Form'
  • Replace all ~VB.CommandButton~ with the ~EXBUTTONLibCtl.Button~ and save the form1.frm file.

Now, the idea to replace the old VB button with the new button is to use a tool that's able to find and replace strings. For instance if you have multiple vbp files adding the object reference to the files could be like follows. Look for a property in the .vbp file that could be located in all your vbp files, like VersionCompanyName ( or whatever ) and do Replace('VersionCompanyName="YourCompanyName"', 'VersionCompanyName="YourCompanyName"\r\nObject={65D9132C-B295-42A0-8421-B8B1DA27C5CE}#1.0#0; ExButton.dll'. This way you actually added the reference to the project file. The same for the file reference in the frm files where the 'Begin VB.Form' could be located.

3:
We assume that you have already a skin file ( else you can search for *.ebn files in the samples folder of the Exontrol's ExButton ). 

There are two options to load your skin file to the button using the Skin or FocusSkin method of the ExButton:

  • converting the skin file to a BASE64 encoded string.  
  • loading directly the file 

Converting the skin file to a BASE64 encoded string is possible using the Exontrol's ExImages tool. It is free to use, so you have to download it and to run the ExImages.exe file.

Open a Windows Explorer, locate your skin file and drag the file over the area "Drag here a file such of .... ". The tool generates the BASE64 encoded string in two formats: VB or Template. 

The VB format shows like follows:

Dim s as String
s = "gBFLBCJwBAEHhEJAEGg4BV4Fg6AABACAxWgKBADQKAAyDIKsEQGGIZRhhGIwAgaFIX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PTnEyPUHohxoD6A+LQIwiRogqBSEUdAtQMiiFoG4RlfwahHDSAUD4pAqB6EkFIDQSwkDoEXRxLAfgpC6C2EsFIdQYimAoM4S40wtBlCaKkUoNxThUHMJ"
s = s + "4KYig+hOHSP0HopRqCojeNEfoUQ1A9CMKkuApQqDaEmFMdQZQoCpGqEYVQVQdCtCoKoYoVRVg1C8KIV41AxCMGoEUMIrAqiOFkFYLQzQsjrCKGkVoVRXCzBIOQUAUwIhqBSK4JArhdAiFUO0Lg6xeh1FeAgUwtxKDSAEQEA="

and it can be copied and pasted to your VB, VC code.

The Template form looks like:

Template: "gBFLBCJwBAEHhEJAEGg4BV4Fg6AABACAxWgKBADQKAAyDIKsEQGGIZRhhGIwAgaFIXQKMUIxVAcLQxCgCYRhYABRiUAoJkjkMYhSDOFgzARHcxRPDgARrDyZQAkOQ5FDGFo+ShFQxTRC9CQpHaEYqkeA3fgmTYXTxJM7yfQVFxlCwTIwFGQqJgmVpPABYERyWKoSzJMyERpGCyIDqqbJXVxFYj3DCscw/KIYaqlGS5Ni+IZ2TLNMz4BAdEQfKSEaAgOToboaE5GB5GeRRbT1HYtKDEcQhepIbpaH5YQjkMBibBNZ4pAavcroeK7FqeI5ua7ach5fisB5EAARYREGrcEqPGZ5ShjGJ1MK0CxzIwDboBPbNdwXP56cIAAx8IJbD0GJQGoIQ1jgGAbhmTZXGsLZ7AsTpKDEVolG0QAaJyA4bleZgCiEJpjHmSJaGENgLgwRpTgUCAhAMEIElCSZ+EUAxkCQKB2huJR0BgRQPkAPZuFOCpSGgewckOUACBSBYhFgXgagYYZIGIHoGmGeB2CCCJiCiFghgmYhIiIJoFmEEZtEwAAilKFB9JWUooi2DRjHiWg4g6Y4onYOYPmOSQCD6EBkEkDhGhCJIJBYSYRmOCJIFKCxhmMBIuCwZQpFIU4VGWCReFqFYlkkZjpGWaYGGCGJlnmFhihmJhJh4F4Hg+eY0kULILFmPhxhwJwplYdIdmcOZmHaHongmbh+h8aAJnKAofmgOgG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URTA2CMIg144w+BtEWNENAeBHgRikGMXgdqgjuB6EcbA8wPjjHIIAR40gDBCCQDkBoIBSBEEKJEGQHgdTVHsDwQ4lBHiSBkEIJISQsgpBKOQTgmRJDSDUEwJIuQegnDKAQTglApB+CiMpboI0kj0A+HIUwVRlCpCyCscodBYiVFkM4LASwkhlBaGUYgtxLhSG0F4JYmQ9guHKEujggxqB6GYDkRYMQTA0GSJkCYLgxjMGyJUGYpgyDPE0FMIwagmgJFaDQcwvBqiYGmAgPYjw4j5BuGYfg3hOATEcHEJwWRhg5HOCQdAnBpimDsE4XI3QdCnEIO0TwMxfBumqPoHwRxmD3E+DMcQfQnjZHyD8c58xPjUAVKYHQDQghoCKAQUIVAPTnEyPUHohxoD6A+LQIwiRogqBSEUdAtQMiiFoG4RlfwahHDSAUD4pAqB6EkFIDQSwkDoEXRxLAfgpC6C2EsFIdQYimAoM4S40wtBlCaKkUoNxThUHMJ4KYig+hOHSP0HopRqCojeNEfoUQ1A9CMKkuApQqDaEmFMdQZQoCpGqEYVQVQdCtCoKoYoVRVg1C8KIV41AxCMGoEUMIrAqiOFkFYLQzQsjrCKGkVoVRXCzBIOQUAUwIhqBSK4JArhdAiFUO0Lg6xeh1FeAgUwtxKDSAEQEA="

and it can be used in Template pages. Also, the tool displays the length of the string that's required to hold the file you dragged. Important to notice is that the ExImages tool compresses the file before generating the BASE64 encoded string, but converting it to a BASE64 string it means that the size of the string will be with 1/4 greater than compressed file. The BASE64 encoded strings are useful to hold your icons, pictures, skins in string instead adding all kind of files to your application.

So, after we get the BASE64 encoded string all that you need to do is to pass the s variable to Skin, or FocusSkin method like in the following sample:

With Button1
	Dim s As String
	s = "gBFLBCJwBAEHhEJAEGg4BV4Fg6AABACAxWgKBADQKAAyDIKsEQGGIZRhhGIwAgaFIXQKMUIxVAcLQxCgCYRhYABRiUAoJkjkMYhSDOFgzARHcxRPDgARrDyZQAkOQ5FDGFo+ShFQxTRC9CQpHaEYqkeA3fgmTYXTxJM7yfQVFx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kUoNxThUHMJ"
	s = s + "4KYig+hOHSP0HopRqCojeNEfoUQ1A9CMKkuApQqDaEmFMdQZQoCpGqEYVQVQdCtCoKoYoVRVg1C8KIV41AxCMGoEUMIrAqiOFkFYLQzQsjrCKGkVoVRXCzBIOQUAUwIhqBSK4JArhdAiFUO0Lg6xeh1FeAgUwtxKDSAEQEA="
	.Skin exNormal, s
End With

The sample shows how to apply a skin to the exNormal state of the button. Using the same way you can assign skin for any state of the button, and you can assign skins for states  that you are going to use, not for all. For instance, if you have AllowHotState property is False, the exHot state should not be assigned ( because it is never used ). Also, if you have UseFocusSkin property on True, instead calling the Skin method you should call FocusSkin method. Also, if multiple skins are applied in the same time we would recommend using the the BeginUpdate and EndUpdate methods. You will find a simple sample bellow this page.

Loading directly the file is possible by passing the path to the skin file to the Skin or FocusSkin method like in the following sample:

With Button1
	.Skin exNormal, "D:\Exontrol\ExButton\project\skins\XPSilver\normal.ebn"
End With

Use the BeginUpdate and EndUpdate methods to avoid painting the button while adding skins for each state of the button like in the following sample:

With Button1
	.BeginUpdate
		Dim strPath As String
		strPath = "D:\Exontrol\ExButton\sample\VB\Builder\Predefined\XPSilver\"
		.UseFocusSkin = True
		.Skin exNormal, strPath + "normal.ebn"
		.Skin exHot, strPath + "hot.ebn"
		.Skin exPushed, strPath + "pushed.ebn"
		.FocusSkin exNormal, strPath + "focus.ebn"
	.EndUpdate
End With
4:
The Skin property assigns a different skin ( visual appearance ) for the button. The Skin property changes the visual appearance for all buttons the same Style property.  So, if you would like to have a different skin for buttons you need to have different values for the Style property like in the following sample:
Dim s As String
With Button1
	.Style = exCustom1
	s = "gBFLBCJwBAEHhEJAEGg4BPgCg6AADACAxRDAMgBQKAAzQFAYaBoHKGAAGQYRRgmFgAQhFcZQSKUOQTDKNYyAWCYRhQMQCQiMYxxCKQZBnEAZQIkGY4ah2A42RhNETxDIsKRAGKYJAgeapAiGPIfQjKEBvfBNGQ1HqgIRqGA5PhySozSAJUZiTIlEQHK6nAAsGJpM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AJUZiTIlEQHK6nAAsGJpMDUJZlWbCIyjBZMBzXNqsK5jIR7SjmOobVBVcpSZJ0YRHO6aJwnChZaoeBI+VJQMdaawwAAeR5NdbABYFGzxKTEIIxKZ6XiGWYJZBAYqwTakBxBSqlcrmexrIhGb6uWxEObUToEEhHBIQcjwC5ZGrqVZUVaNQzYdC2HAPOoFdy3MALZinPwADLwIzZbBvD8X4ElcIBgG4VpvFsHJWFqNg+BuBBai+J5aECdIgACfwvGeJoEgKIQmBMEYMkgZQzAuDBGlOBQICEAwQgSUJJn4RZDGQJAoHYG4FCAGBFk+QA9m0QJKlIaB7gQR7Wj0AAhGgYgXgYYZIG4HoGiICB2CGB5iCiFgkgmYg4iYJoKiKCBmBSBQAAgUgrgyYpYlYLINmMSJiDaDhjkgXgwgiEAzGYQYQkACQKEWEQkGkJhIhKZB5DYSoTiSSQ+FKFBlEkQhWDYZAJAIV4VGUORuF6FxmAkchiheZQZGYH4YmYGYSGqGhmkmIhuhOJhogIb4bGaOZOHaHVgkYGYdmcSZ2HyH5ngkYhnhaJ5qAaAIhGiCYiHqBZoHoNoGiOaI"
	s = s + "ZkKA4ZmkCg6hGJZnkoLQJiYKRaHaHIiCmKhaiKJ4qDkJohikKoKH6JYSCoeoqimKpqhqNowiuKxKGaE4ciqepmjWLBrHmbo6iybAJmaPYjCuewWjuKAsDobpBjGbI6jKSYzGwaxCiaM5tBsVpMheawrFqUosm2Gxel6NItlsbpai6Lgbg6X4xi4W4emqKRuhuCprieLpbhqboticKgSnOPIrkuVoUjub5LjKVI/G+CpSECDIjjwFg6kGY5cCMBpCGKOJCC+BIwkwLwSkKMRMEcFJDkeMABAEgIA=="
	.Skin exNormal, s
End With
5:
6:
The EBN_DRAW registered message does the trick. Use the RegisterWindowMessage API function to get the identifier of the EBN_DRAW message. Send this message to the eXButton by passing, the state and the handle to the device context, and the clipping region will show the button's state.

The following VB sample shows how to print the eXButton's EBN object on the Form's background. Insert the eXButton component to a form, and use the following code:

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long

Private Sub Form_Paint()
    Me.Cls
    SendMessage Form1.Button1.hwnd, RegisterWindowMessage("EBN_DRAW"), 0, ByVal Me.hwnd
End Sub

The following C++ sample shows how to print the eXButton's EBN object on the dialog's background. Insert the eXButton component to the form, and use the following code:

void OnPaint()
{
	CPaintDC dc(this); // device context for painting
	m_button.SendMessage( RegisterWindowMessage( _T("EBN_DRAW") ), 0, (LPARAM)dc.m_hDC );
}

The LPARAM parameter of the SendMessage API could be

  • HWND - a handle to a window where the EBN object should be painted
  • HDC - a handle to device context.

In both cases, the clipping region determines the area to show the EBN object, so you can use the SelectClipRgn API function to specify the area where the EBN object should be shown.

How-To Questions
General Questions