vba - How to display 'Tooltip' for a Group (textbox + images) Assigned to Macro? -
context:
i have several groups i've made in excel 2007 each consist of textbox , image(s) , each assigned macro.
what upon mouseover/hover of group, displays 'tooltip' contains more detailed info assigned macro does. i've come across looks solution here: http://www.vbaexpress.com/forum/showthread.php?t=15084 however, don't know how figure out assigned name image can use name in code, , i'm not sure how incorporate use group object instead, or if it's possible groups.
question:
as per title, how display tooltip/infotip group (textbox + images) assigned macro?
edit: i've enclosed copy of code found in link people don't have go page hopping:
code goes in general, public module:
option explicit declare function getsystemmetrics lib "user32" ( _ byval nindex long) long declare function getsyscolor lib "user32" ( _ byval nindex long) long public function createtooltiplabel(objhostole object, _ sttltext string) boolean dim objtooltiplbl oleobject dim objole oleobject const sm_cxscreen = 0 const color_infotext = 23 const color_infobk = 24 const color_windowframe = 6 application.screenupdating = false 'just while label created , formatted each objole in activesheet.oleobjects if objole.name = "ttl" objole.delete 'only 1 can exist @ time next objole 'create label control... set objtooltiplbl = activesheet.oleobjects.add(classtype:="forms.label.1") '...and format tooltipwindow objtooltiplbl .top = objhostole.top + objhostole.height - 10 .left = objhostole.left + objhostole.width - 10 .object.caption = sttltext .object.font.size = 8 .object.backcolor = getsyscolor(color_infobk) .object.backstyle = 1 .object.bordercolor = getsyscolor(color_windowframe) .object.borderstyle = 1 .object.forecolor = getsyscolor(color_infotext) .object.textalign = 1 .object.autosize = false .width = getsystemmetrics(sm_cxscreen) .object.autosize = true .width = .width + 2 .height = .height + 2 .name = "ttl" end doevents application.screenupdating = true 'delete tooltip window after 5 secs application.ontime now() + timevalue("00:00:05"), "deletetooltiplabels" end function public sub deletetooltiplabels() dim objtooltiplbl oleobject each objtooltiplbl in activesheet.oleobjects if objtooltiplbl.name = "ttl" objtooltiplbl.delete next objtooltiplbl end sub code goes in sheet (right click sheet tab>code)
private sub image1_mousemove(byval button integer, _ byval shift integer, _ byval x single, _ byval y single) dim objttl oleobject dim fttl boolean each objttl in activesheet.oleobjects fttl = objttl.name = "ttl" next objttl if not fttl createtooltiplabel image1, "tooltip label" end if end sub
Comments
Post a Comment