Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I show an extracted icon on a button

Status
Not open for further replies.

georg59

Programmer
Sep 1, 2001
26
DE
My problem is, I like to create an icon that starts on click event a document with the associated application. With ExtractAssociatedIcon I can extract the icon and with DrawIcon I can show it on the form. Is there any way to show this icon on a button "on the fly"?
Thanks for all answers...
 
georg59

WITH THISFORM.cmButton1
[tab].Caption = []
[tab].Picture = [path\filename.ext]
[tab].Refresh()
ENDW
FAQ184-2483 - the answer to getting answered.​

Chris [pc2]
 
HI george,

** myFile name with full path and extension

myCommandButton.picture = myFileName
myCommandButton.Height = nnn (suitable to hold Picture)
myCommandBUtton.Refresh()

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Hello Chris, hello Ramani,
thanks for your very fast answers, but unfortunately they don't solve my problem. It is, that I havn't this icon as a file but as an icon handle get by ExtractAssosiatedIcon function.
 
georg59

'with DrawIcon I can show it on the form'

Could you not use a transparent shape with a curvature of say 9, place the shape over the icon with .ZOrder(0) and then use the .Click() event of the shape to fire whatever you need?
FAQ184-2483 - the answer to getting answered.​

Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top