home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / activex / demos / oletrial / samples / vb / mhtip / mhtip_b.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-02  |  4.4 KB  |  111 lines

  1. VERSION 4.00
  2. Begin VB.Form fProperties 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "MicroHelp VBTools 5 - MhTip Example"
  6.    ClientHeight    =   3936
  7.    ClientLeft      =   2640
  8.    ClientTop       =   4140
  9.    ClientWidth     =   5832
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   7.8
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   4404
  21.    Left            =   2580
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   3936
  24.    ScaleWidth      =   5832
  25.    Top             =   3732
  26.    Width           =   5952
  27.    Begin VB.TextBox txtProperties 
  28.       Appearance      =   0  'Flat
  29.       BeginProperty Font 
  30.          name            =   "MS Sans Serif"
  31.          charset         =   0
  32.          weight          =   700
  33.          size            =   7.8
  34.          underline       =   0   'False
  35.          italic          =   0   'False
  36.          strikethrough   =   0   'False
  37.       EndProperty
  38.       Height          =   3075
  39.       Left            =   0
  40.       MultiLine       =   -1  'True
  41.       ScrollBars      =   2  'Vertical
  42.       TabIndex        =   0
  43.       Top             =   0
  44.       Width           =   4695
  45.    End
  46. Attribute VB_Name = "fProperties"
  47. Attribute VB_Creatable = False
  48. Attribute VB_Exposed = False
  49. Dim s_NEWLINE As String
  50. Private Sub Form_Load()
  51. Dim sCode As String
  52.     s_NEWLINE = Chr$(13) & Chr$(10)
  53.     s_TAB = Chr$(9)
  54.     ' Display code to include in your app.
  55.     sCode = sCode & s_TAB & "' Copy this code to your project's Form_Load"
  56.     sCode = sCode & s_NEWLINE & s_TAB & "' to recreate the current MhTip appearance."
  57.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("AutoSize", fMain!MhTip1)
  58.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("AutoSizeToText", fMain!MhTip1)
  59.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("Alignment", fMain!MhTip1)
  60.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("VAlignment", fMain!MhTip1)
  61.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("BorderStyle", fMain!MhTip1)
  62.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("FontName", fMain!MhTip1)
  63.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("FontSize", fMain!MhTip1)
  64.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("FontBold", fMain!MhTip1)
  65.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("TipChildren", fMain!MhTip1)
  66.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("MultiLine", fMain!MhTip1)
  67.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("TipStyle", fMain!MhTip1)
  68.     sCode = sCode & s_NEWLINE & s_TAB & PropValue("FillColor", fMain!MhTip1)
  69.     ' Put Code in text box.
  70.     txtProperties.Text = sCode
  71.     ' center form to screen
  72.     Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2
  73. End Sub
  74. Private Sub Form_Resize()
  75.     ' Resize text box to form.
  76.     txtProperties.Width = fProperties.ScaleWidth
  77.     txtProperties.Height = fProperties.ScaleHeight
  78. End Sub
  79. Private Function PropValue(sProp As String, MhTip1 As MhTip) As String
  80. Dim sCode As String
  81.     ' Return code that will set the specified property.
  82.     sCode = "MhTip1." & sProp & " = "
  83.     Select Case sProp
  84.         Case "AutoSize"
  85.             sCode = sCode & Format$(MhTip1.AutoSize)
  86.         Case "AutoSizeToText"
  87.             sCode = sCode & Format$(MhTip1.AutosizeToText)
  88.         Case "Alignment"
  89.             sCode = sCode & Format$(MhTip1.Alignment)
  90.         Case "VAlignment"
  91.             sCode = sCode & Format$(MhTip1.VAlignment)
  92.         Case "BorderStyle"
  93.             sCode = sCode & Format$(MhTip1.BorderStyle)
  94.         Case "FontName"
  95.             sCode = sCode & """" & MhTip1.FontName & """"
  96.         Case "FontSize"
  97.             sCode = sCode & Format$(MhTip1.FontSize)
  98.         Case "FontBold"
  99.             sCode = sCode & Format$(MhTip1.FontBold)
  100.         Case "TipChildren"
  101.             sCode = sCode & Format$(MhTip1.TipChildren)
  102.         Case "MultiLine"
  103.             sCode = sCode & Format$(MhTip1.MultiLine)
  104.         Case "TipStyle"
  105.             sCode = sCode & Format$(MhTip1.TipStyle)
  106.         Case "FillColor"
  107.             sCode = sCode & "&H" & Format$(Hex(MhTip1.FillColor)) & "H"
  108.     End Select
  109.     PropValue = sCode
  110. End Function
  111.