Wiki Home

Whats This Help Button


Namespace: DotNet
Use this code to build your own Whats This Help Button for forms that Microsoft decided didn't deserve a [?] button in the title bar
(Isn't it funny that in Windows2000 more forms automatically get a Whats This Help button? Notice you can use Marlett Font for the ? in the caption)
**************************************************
DEFINE CLASS aaswhatsthisbutton AS commandbutton
  Name = "whatsthisbutton"
  Height = 20
  Width = 24
  FontBold = .F.
  FontName = "Marlett"
  FontSize = 9
  Caption = "s"
  ToolTipText = "Click this button then something else for What's This help!"


  PROCEDURE Init
  with THIS
    if NOT .autoResizeHeight and not .AutoResizeWidth
      .Height = SysMetric(9)-2 && Height of window Title
      .Width  = SysMetric(9)-2 && Height of window Title
    endif
    if     NOT .autoResizeFont and not .autoResizeHeight ;
       and not .AutoResizeTop  and not .AutoResizeWidth  ;
       and .AutoResizeLeft
      .Top    = 0
      .Left   = THISFORM.Width - .Width - 1
    endif
  endwith
  ENDPROC

  PROCEDURE Click
    THISFORM.WhatsThisMode()
  ENDPROC
ENDDEFINE
*
*-- EndDefine: aaswhatsthisbutton
**************************************************

Contributors: wgcs
Category Code Samples Category Help
( Topic last updated: 2001.01.22 10:42:53 AM )