home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form fMain
- BorderStyle = 1 'Fixed Single
- Caption = "MicroHelp VBTools 5 - MhTip Example"
- ClientHeight = 4092
- ClientLeft = 1056
- ClientTop = 2892
- ClientWidth = 8220
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 4560
- Left = 996
- LinkTopic = "Form1"
- ScaleHeight = 4092
- ScaleWidth = 8220
- Top = 2484
- Width = 8340
- Begin VB.CommandButton cmdAction
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "E&xit"
- Height = 510
- Index = 1
- Left = 6255
- TabIndex = 18
- Top = 3015
- Width = 1815
- End
- Begin VB.ComboBox cboTipConfig
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 315
- Left = 1845
- Style = 2 'Dropdown List
- TabIndex = 14
- Top = 270
- Width = 2940
- End
- Begin VB.CommandButton cmdAction
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "&View Properties..."
- Height = 510
- Index = 0
- Left = 6255
- TabIndex = 16
- Top = 2430
- Width = 1815
- End
- Begin VB.Frame fraSettings
- Caption = "Style"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 1230
- Index = 2
- Left = 2835
- TabIndex = 11
- Top = 2295
- Width = 1950
- Begin VB.OptionButton optStyle
- Caption = "Balloon tip."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Index = 1
- Left = 225
- TabIndex = 13
- Top = 630
- Width = 1275
- End
- Begin VB.OptionButton optStyle
- Caption = "Square tip."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Index = 0
- Left = 225
- TabIndex = 12
- Top = 360
- Value = -1 'True
- Width = 1275
- End
- End
- Begin VB.Frame fraSettings
- Caption = "AutoSizing Features"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 1230
- Index = 1
- Left = 135
- TabIndex = 7
- Top = 2295
- Width = 2535
- Begin VB.OptionButton optAutoSize
- Caption = "No AutoSize."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Index = 0
- Left = 225
- TabIndex = 10
- Top = 315
- Value = -1 'True
- Width = 1455
- End
- Begin VB.OptionButton optAutoSize
- Caption = "AutoSize to Text."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Index = 1
- Left = 225
- TabIndex = 9
- Top = 585
- Width = 1770
- End
- Begin VB.OptionButton optAutoSize
- Caption = "AutoSize to Picture."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Index = 2
- Left = 225
- TabIndex = 8
- Top = 855
- Width = 1995
- End
- End
- Begin VB.PictureBox picTipPicture
- Appearance = 0 'Flat
- AutoSize = -1 'True
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 1332
- Left = 4995
- Picture = "mhtip_a.frx":0000
- ScaleHeight = 1308
- ScaleWidth = 996
- TabIndex = 4
- Top = 1935
- Visible = 0 'False
- Width = 1020
- End
- Begin VB.PictureBox picStatusBar
- Align = 2 'Align Bottom
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 420
- Left = 0
- ScaleHeight = 396
- ScaleWidth = 8196
- TabIndex = 2
- Top = 3675
- Width = 8220
- Begin VB.Label lblComment
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BeginProperty Font
- name = "Arial"
- charset = 0
- weight = 400
- size = 8.4
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 240
- Left = 135
- TabIndex = 3
- Top = 90
- Width = 1950
- End
- End
- Begin VB.Frame fraSettings
- Caption = "Display Settings"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 1410
- Index = 0
- Left = 135
- TabIndex = 0
- Top = 765
- Width = 4650
- Begin VB.CheckBox chkMultiLine
- Caption = "Set the .MultiLine property."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 270
- TabIndex = 6
- Top = 945
- Width = 2625
- End
- Begin VB.CheckBox chkStatusBar
- Caption = "Display tip captions in the status bar."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 270
- TabIndex = 5
- Top = 675
- Width = 3480
- End
- Begin VB.CheckBox chkTipChildren
- Caption = "Set the .TipChildren property."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 270
- TabIndex = 1
- Top = 405
- Width = 2805
- End
- End
- Begin MhtipLib.MhTip MhTip1
- Height = 264
- Left = 4992
- TabIndex = 19
- Top = 1668
- Width = 732
- _Version = 65536
- _ExtentX = 1291
- _ExtentY = 466
- _StockProps = 79
- Caption = "MhTip1"
- BevelStyle = 1
- BevelStyleInner = 0
- BevelSize = 1
- BorderColor = -2147483642
- FillColor = -2147483624
- LightColor = -2147483628
- Multiline = 0 'False
- NoPrefix = -1 'True
- ShadowColor = -2147483632
- TextColor = -2147483625
- VAlignment = 0
- WallPaper = 0
- Picture = "mhtip_a.frx":133E
- Alignment = 0
- FontTransparent = -1 'True
- BevelSizeInner = 0
- FontStyle = 0
- AutoSize = -1 'True
- Interval = 1000
- TipOffsetTop = 10
- TipOffsetLeft = 10
- AutosizeToText = -1 'True
- BorderStyle = 1
- TipStyle = 0
- TipChildren = 0 'False
- NoTipCapture = 0 'False
- End
- Begin VB.Label Label1
- Caption = $"mhtip_a.frx":135A
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 1410
- Left = 4995
- TabIndex = 15
- Top = 180
- Width = 3075
- End
- Begin VB.Label lblTipConfig
- Caption = "Tip Configuration:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 240
- Left = 180
- TabIndex = 17
- Top = 315
- Width = 1590
- End
- Attribute VB_Name = "fMain"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim sComments(0 To 10) As String
- ' Create a 3-D effect either pushing in
- ' or out.
- Private Sub Border1(Picture As Control, Direction As String, Depth As Integer)
- Dim lTopLeft As Long
- Dim lBottomRight As Long
- Dim iWidth As Integer
- If UCase$(Direction) = "IN" Then
- lTopLeft = RGB(128, 128, 128)
- lBottomRight = RGB(255, 255, 255)
- End If
- If UCase$(Direction) = "OUT" Then
- lTopLeft = RGB(255, 255, 255)
- lBottomRight = RGB(128, 128, 128)
- End If
- Picture.ScaleMode = 3
- Picture.DrawWidth = 1
- Picture.BackColor = &HC0C0C0
- For iWidth = 0 To Depth - 1
- Picture.Line (iWidth, iWidth)-(iWidth, Picture.ScaleHeight - iWidth), lTopLeft
- Picture.Line (iWidth, iWidth)-(Picture.ScaleWidth - iWidth, iWidth), lTopLeft
- Picture.Line (Picture.ScaleWidth - iWidth - 1, iWidth + 1)-(Picture.ScaleWidth - iWidth - 1, Picture.ScaleHeight - iWidth), lBottomRight
- Picture.Line (iWidth + 1, Picture.ScaleHeight - iWidth - 1)-(Picture.ScaleWidth - iWidth, Picture.ScaleHeight - iWidth - 1), lBottomRight
- Next
- Picture.ScaleMode = 1
- End Sub
- Private Sub cboTipConfig_Change()
- ' Set specific properties of the MhTip.
- Select Case cboTipConfig.Text
- Case "(None)"
- ' Display Settings.
- chkTipChildren.Value = 0
- chkStatusBar.Value = 0
- chkMultiLine.Value = 0
- ' Autosize features.
- optAutoSize(0).Value = True
- ' Style.
- optStyle(0).Value = True
- Case "Simple Tips"
- ' Display Settings.
- chkTipChildren.Value = 1
- chkStatusBar.Value = 0
- chkMultiLine.Value = 0
- ' Autosize features.
- optAutoSize(1).Value = True
- ' Style.
- optStyle(0).Value = True
- Case "Legal Pad"
- ' Display Settings.
- chkTipChildren.Value = 1
- chkStatusBar.Value = 0
- chkMultiLine.Value = 1
- ' Autosize features.
- optAutoSize(2).Value = True
- ' Style.
- optStyle(0).Value = True
- Case "Word-Balloon"
- ' Display Settings.
- chkTipChildren.Value = 1
- chkStatusBar.Value = 0
- chkMultiLine.Value = 1
- ' Autosize features.
- optAutoSize(1).Value = True
- ' Style.
- optStyle(1).Value = True
- Case "Status Bar"
- ' Display Settings.
- chkTipChildren.Value = 1
- chkStatusBar.Value = 1
- chkMultiLine.Value = 0
- ' Autosize features.
- optAutoSize(0).Value = True
- ' Style.
- optStyle(0).Value = True
- End Select
- End Sub
- Private Sub cboTipConfig_Click()
- cboTipConfig_Change
- End Sub
- Private Sub chkMultiLine_Click()
- ' Toggle whether the MhTip control
- ' will display text on multiple lines.
- MhTip1.MultiLine = Not MhTip1.MultiLine
- End Sub
- Private Sub chkTipChildren_Click()
- ' Toggle whether the MhTip control
- ' fires over child controls within containers.
- MhTip1.TipChildren = Not MhTip1.TipChildren
- End Sub
- Private Sub cmdAction_Click(Index As Integer)
- Select Case Index
- ' View properties.
- Case 0
- fProperties.Show 1
- ' Exit.
- Case 1
- Unload fMain
- End Select
- End Sub
- Private Sub Form_Load()
- ' Load configuration settings.
- ' These are different groups of property settings
- ' that give the MhTip control unique looks.
- cboTipConfig.AddItem "(None)"
- cboTipConfig.AddItem "Simple Tips"
- cboTipConfig.AddItem "Legal Pad"
- cboTipConfig.AddItem "Word-Balloon"
- cboTipConfig.AddItem "Status Bar"
- cboTipConfig.ListIndex = 0
- ' center form to screen
- Move Abs(Screen.Width - Width) \ 2, Abs(Screen.Height - Height) \ 2
- End Sub
- Private Sub lblComment_Change()
- lblComment.Width = picStatusBar.TextWidth(lblComment.Caption)
- End Sub
- ' This event is fired when the mouse pointer
- ' leaves a control and the MhTip control disappears.
- Private Sub MhTip1_HideTip()
- Debug.Print "_HideTip event fired"
- End Sub
- ' This event is fired every time the mouse pointer
- ' moves over a control.
- Private Sub MhTip1_SetCaption(ControlName As String, hWnd As Integer, MakeVisible As Integer, MouseX As Integer, MouseY As Integer)
- Dim sTipCaption As String
- Dim iShowInStatus As Integer
- Debug.Print "_SetCaption event fired"
- iShowInStatus = chkStatusBar.Value
- ' Setting the parameter MakeVisible to False
- ' will stop the MhTip control from displaying.
- ' You can then display the desired caption elsewhere.
- If iShowInStatus Then MakeVisible = False
- ' Set caption string.
- sTipCaption = ""
- Select Case ControlName
- ' Frames (groups).
- Case "fraSettings(0)"
- sTipCaption = "Group - Set up when the MhTip control will display."
- Case "fraSettings(1)"
- sTipCaption = "Group - Set up how the MhTip control will resize to its contents."
- Case "fraSettings(2)"
- sTipCaption = "Group - Set up what the MhTip control will look like."
- ' Configuration.
- Case "cboTipConfig"
- sTipCaption = "Set groups of properties to give the MhTip a unique look."
- ' Display Settings.
- Case "chkTipChildren"
- sTipCaption = "Check to allow MhTip to fire over child controls."
- Case "chkStatusBar"
- sTipCaption = "Check to turn off the MhTip and display tip captions in the status bar."
- Case "chkMultiLine"
- sTipCaption = "Check to word-wrap the contents of the MhTip control across several lines."
- ' Autosize features.
- Case "optAutoSize(0)"
- sTipCaption = "Do not resize the MhTip control."
- Case "optAutoSize(1)"
- sTipCaption = "Resize the MhTip control to the size of the text in the .Caption property."
- Case "optAutoSize(2)"
- sTipCaption = "Resize the MhTip control to the size of the picture in the .Picture property."
- ' Style.
- Case "optStyle(0)"
- sTipCaption = "Display a square tip."
- Case "optStyle(1)"
- sTipCaption = "Display a tip in the shape of a word-balloon."
- ' Buttons.
- Case "cmdAction(0)"
- sTipCaption = "View the important property settings for the current MhTip."
- Case "cmdAction(1)"
- sTipCaption = "Exit this example application."
- ' Don't display if there is no tip.
- Case Else
- sTipCaption = "Ready."
- MakeVisible = False
- End Select
- ' Display caption in appropriate control:
- ' either the MhTip or the status bar (lblComment).
- If iShowInStatus Then
- lblComment.Caption = sTipCaption
- Else
- MhTip1.Caption = sTipCaption
- lblComment.Caption = "Ready."
- End If
- End Sub
- Private Sub optAutoSize_Click(Index As Integer)
- ' Many diplay properties (such as .BorderStyle and .FontBold)
- ' are set to accommodate the changes in alignment.
- Select Case Index
- ' No AutoSize.
- Case 0
- ' Autosize.
- MhTip1.AutoSize = False
- MhTip1.AutosizeToText = False
- ' Alignment.
- MhTip1.Alignment = 1
- MhTip1.VAlignment = 1
- ' Image.
- MhTip1.Picture = LoadPicture("")
- MhTip1.BorderStyle = 1
- MhTip1.FontBold = False
- ' AutoSize to Text.
- Case 1
- ' Autosize.
- MhTip1.AutoSize = False
- MhTip1.AutosizeToText = True
- ' Alignment.
- MhTip1.Alignment = 1
- MhTip1.VAlignment = 1
- ' Image.
- MhTip1.Picture = LoadPicture("")
- MhTip1.BorderStyle = 2
- MhTip1.FontBold = False
- ' AutoSize to Picture.
- Case 2
- ' Autosize.
- MhTip1.AutoSize = True
- MhTip1.AutosizeToText = False
- ' Alignment.
- MhTip1.Alignment = 2
- MhTip1.VAlignment = 2
- ' Image.
- MhTip1.Picture = picTipPicture.Picture
- MhTip1.BorderStyle = 0
- MhTip1.FontBold = True
- End Select
- End Sub
- Private Sub optStyle_Click(Index As Integer)
- ' Specify whether the MhTip control appears
- ' as a box or a word ballon.
- MhTip1.TipStyle = Index
- End Sub
- Private Sub picStatusBar_Paint()
- Border1 picStatusBar, "OUT", 1
- End Sub
- Private Sub ViewProperties()
-
- End Sub
-