 The HotButton control is an alternative
to the standard Windows button for C++ or Command Button that ships with Visual
Basic, anc can also be used on webpages by using the text properties provided
(for things like fonts and image paths).
Setting Properties Programmatically
Most properties can be set programmatically directly at
runtime. For example,
HotButton1.BackColor =
&HFF0000
The Font properties are the exception. To set the
font properties at runtime, you must do it by getting a reference to the Font
object, setting the properties on it, then setting the Font object back into the
HotButton. Here is an example:
Dim font As IFontDisp
Set font = HotButton1.font
font.Bold = True
Set HotButton1.font = font
Using Graphics from EzStor files
One of the coolest things you can do with the HotButton is
use graphics stored in EzStor files that you ship with your Windows
applications. This feature is essential when using HotButtons on webpages.
For example, suppose you are embedding WOW controls in your Windows app, and you
want to take advantage of the cool features of the HotButton on the webpage. The form of the path for the HotButton is:
<external path>::<internal path>
Example
c:/Program Files/MyApp/Sample.hsp::graphics/logo.gif
Using our HSP product, you can generate the HTML for the
page dynamically, including the path to the EzStor file. You would use the Server.MapExternalPath method to obtain a path to the EzStor/HSP
file, then use this path in the PARAM tag. Here is an example:
<%
Dim strExtPath
strExtPath = Server.MapExternalPath("Sample.hsp::graphics/")
%>
<OBJECT classid="clsid:D7E03B4F-415B-4cc0-A6E1-43D3886CA698" id="btnBack"
width="56" height="14">
<PARAM NAME='_cx' VALUE='1750' />
<PARAM NAME='_cy' VALUE='850' />
<PARAM NAME='ImagePath' VALUE='<%=strExtPath + "prev.bmp"%>' />
<PARAM NAME='HotImagePath' VALUE='<%=strExtPath + "prev_hot.bmp"%>' />
</object>
Using Graphics from Resources compiled
into your .EXE files
Another cool thing you can do with the HotButton is
use graphics compiled into your .EXE as Windows resources. To do this, you must
create custom ICO resources in you .rc file, something like this:
IDI_DELETE ICO
DISCARDABLE "res\\delete.ico"
Then, set the "ImageResID" and "ImageResType" properties
of the HotButton to reference this resource. If the value of IDI_DELETE is
202, then set ImageResID=202, and set ImageResType = eICO.
If your module is a DLL, you also need to set the "ModuleName"
property as well. This is so that the HotButton can find the resource in
your module that has been dynamically linked into the running .EXE. For
example, if your DLL name is "mydll.dll", then this is what you set into the
ModuleName property.
Setting Menu Properties as Text
The HotButton's menu definition is stored as text in the "MenuItems"
property. When you use the Menu Builder Property Page of the HotButton, it
stores the menu definition as text. This allows you to create a menu
definition using the Property Page (in VB for example), then copy it as text to use to create
a menu programmatically (in a webpage for example). Here is an example:
<OBJECT classid="clsid:D7E03B4F-415B-4cc0-A6E1-43D3886CA698" id="btnMenu"
width="56" height="14">
<PARAM NAME='_cx' VALUE='1750' />
<PARAM NAME='_cy' VALUE='850' />
<PARAM NAME='MenuStyle' VALUE='2' />
<PARAM NAME='MenuItems' VALUE='text:&1 Technical; id:1; |text:&2 Ivy; id:2; |text:&3
Chess; id:3; |text:; id:0; style:+sep; |text:&Select Stationery...; id:4;
|text:; id:0; style:+sep; |text:&No Stationery; id:5; |text:&Web Page; id:6;
style:+gra+dis;' />
</object>
As you can see, these unique features of the HotButton
allow give you the capability to use HotButtons on webpages. This is
especially useful when you are embedding the WOW control in your Windows
applications, since the HotButton gives you a lot of extra functionality and is
easy to use.
|