Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / April 2006

Tip: Looking for answers? Try searching our database.

option buttons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CAOU - 20 Apr 2006 05:53 GMT
How can include tooltips on an form option button object? and Where can I go
to modify the tab properties for each individual textbox? I tried everything
on the properties. Please help.

thanks,
Bob Phillips - 20 Apr 2006 09:17 GMT
Here is some code for commandbutton tooltips, option buttons should be
similar

To do this, put the following code in a standard code module (making it
available to the whole workbook).

'------------- bas module ------------------------
Option Explicit

Declare Function GetSystemMetrics Lib "user32" ( _
   ByVal nIndex As Long) As Long

Declare Function GetSysColor Lib "user32" ( _
   ByVal nIndex As Long) As Long

Public Function CreateToolTipLabel(objHostOLE As Object, _
                                  sTTLText As String) As Boolean
Dim objToolTipLbl As OLEObject
Dim objOLE As OLEObject

Const SM_CXSCREEN = 0
Const COLOR_INFOTEXT = 23
Const COLOR_INFOBK = 24
Const COLOR_WINDOWFRAME = 6

 Application.ScreenUpdating = False   'just while label is created and
formatted

 For Each objOLE In ActiveSheet.OLEObjects
     If objOLE.Name = "TTL" Then objOLE.Delete 'only one can exist at a
time
 Next objOLE

'create a label control...
 Set objToolTipLbl = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1")

'...and format it to look as a ToolTipWindow
 With 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 With
 DoEvents
 Application.ScreenUpdating = True

'delete the tooltip window after 5 secs
 Application.OnTime Now() + TimeValue("00:00:05"), "DeleteToolTipLabels"

End Function

Public Sub DeleteToolTipLabels()
Dim objToolTipLbl As OLEObject
 For Each objToolTipLbl In ActiveSheet.OLEObjects
     If objToolTipLbl.Name = "TTL" Then objToolTipLbl.Delete
 Next objToolTipLbl
End Sub

Signature

HTH

Bob Phillips

(remove nothere from email address if mailing direct)

> How can include tooltips on an form option button object? and Where can I go
> to modify the tab properties for each individual textbox? I tried everything
> on the properties. Please help.
>
> thanks,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.