Wiki Home

Vfei Tool Pics


Namespace: VFP
* Sets the toolbar picture for all of the buttons in iToolBar.vcx
* Author: CarlKarsten
* It will take the picture from each button and make it the toolbar picture.

local ;
	lnCls

do (_browser) with "c:\vfe6\ilibs\itoolbar.vcx"

with _oBrowser
	for lncls = 1 to .nClassCount
		if .aClassList[ lnCls, 8 ] = "commandbutton"
			lFixPic( .aClassList[ lnCls, 1 ], .aClassList[ lnCls, 6 ] )
		endif
	endfor

	.RefreshClassList()

endwith

return

****************************************
function lFixPic( tcCls, tcLib )

local ;
	laCls(1), lcPic

modify class (tcCls) of (tcLib) nowait
aSelObj( laCls )
lcPic = laCls[1].picture

if !empty( lcPic )

	keyboard "{alt+c}c{tab}{tab}{tab}{tab}"
	* Set the ToolBar icon
	keyboard "{alt+t}" + lcPic 
	* Set the Container icon (used by class browser)
	keyboard "{alt+c}" + lcPic 
	keyboard "{enter}"
	activate window class
	doevents
	SYS(1500, '_MFI_SAVE', '_MSM_FILE')

endif

release window class

return lcPic


Contributors Carl Karsten
Category Visual FoxExpress Category Visual FoxExpress Tips And Tricks
( Topic last updated: 1999.08.20 02:05:50 AM )