Home Features Toolbar Library Forum Download Support Tutorial Manual
3. Reference
Triggers
Controls
Variables
System Variables
Global Values
Functions
AutoFill()
Back()
Beep()
CheckLinks()
Checksum()
Click()
Command()
Customize()
DeleteOption()
Enable()
Execute()
ExportLinks()
Forward()
GetFolderIcon()
GetQuery()
GetSystemIcon()
Header()
Highlight()
HistoryMenu()
Home()
IfExactMatch()
IfMatch()
ImportValue()
ImportCaption()
ImportIntValue()
ImportXMLValue()
Length()
LoadMenu()
Menu()
OpenURL()
Options()
PageText()
PlaySound()
PopupManager()
Refresh()
Replace()
ReplaceAll()
Resize()
ResizeClient()
Redraw()
Save()
Search()
SearchBack()
SearchLast()
SearchNext()
SearchPage()
SetCaption()
SetClipboard()
SetFocus()
SetFontSize()
SetIcon()
SetOption()
SetParam()
SetText()
SetStatusText()
SetTooltip()
SetUserAgent()
SetValue()
Show()
Stop()
StripHTML()
ToolbarMenu()
TruncateOption()
UpdateToolbar()
Zoom()
Text Functions
  

SetIcon() Function

Sets the icon of a specified toolbar control button.

Syntax:

    SetIcon(id,icon)


Parameters:

    id - Identifier of button to set icon for
    icon - link to an icon file to set.


Remarks:



Example:

    This example illustrates how you can can change the icon of a button based bsed on a value imported from an XML file.


    <xml id="toolbar">
    <toolbar caption="SetIcon() Example">
    <control id=iconurl type="edit" hidden=2 onload="GetXMLValue('http://www.mydomain.com/import.xml?url=%URL%',STATUS,ICON)"
    onchange="SetIcon(test,'%ICONURL%')"></control>
    <control type="toolbar">
    <button id=test image="icons/ie.ico" caption="Image Change Test"></button>
    </control>
    </toolbar>
    </xml>


    The iconurl conrol, retrieves the value of the ICON parameter in the STATS XML tag, when ever a new page is loaded in the browser. This is done by the GetXMLVAlue() function. This controls is pernamently hidden and its function is to retrieve and store the icon link.

    When ever the value of the iconurl control changes, the the onchange trigger calls the SetIcon() function which changes the icon of the test toolbar button.


See Also:

    GetSysIcon()


Website Popularity Rank | Build Your Own Toolbar | Free Download | Custom Toolbars | Features | Contact Us

ToolbarBrowser is a freeware project supported by Trellian Limited. | Privacy Policy