'The control's horizontal alignment can be justified
'left, right and centered.
Dim iIndex As Integer
'Turn checks off
For iIndex = 0 To 2
itmAlign(iIndex).Checked = False
Next
'Make choice and set check
Select Case index
Case im_LEFT
Mh3dFrame1.Alignment = index
itmAlign(index).Checked = True
Case im_RIGHT
Mh3dFrame1.Alignment = index
itmAlign(index).Checked = True
Case im_CENTER
Mh3dFrame1.Alignment = index
itmAlign(index).Checked = True
End Select
lblXplain.Caption = Xplain(im_ALIGN)
End Sub
Sub itmBevels_Click(index As Integer)
'Routine picks bevel style for control
Dim iIndex As Integer
'if Bevelsize = 0, there's nothing else to set
'so we tell the user and then exit
If Mh3dFrame1.BevelSize = 0 Then
MsgBox "You must set .BevelSize to something other than zero for this property to have any effect.", 16, "MicroHelp"
Exit Sub
End If
'Turn all the checks off
For iIndex = 0 To 4
itmBevels(iIndex).Checked = False
Next
'Change style and check appropriate menu item
Select Case index
Case im_LOWERED
Mh3dFrame1.BevelStyle = index
itmBevels(index).Checked = True
Case im_RAISED
Mh3dFrame1.BevelStyle = index
itmBevels(index).Checked = True
Case im_CHISELED
Mh3dFrame1.BevelStyle = index
itmBevels(index).Checked = True
Case im_SHADOWLEFT
Mh3dFrame1.BevelStyle = index
itmBevels(index).Checked = True
Case im_SHADOWRIGHT
Mh3dFrame1.BevelStyle = index
itmBevels(index).Checked = True
End Select
lblXplain.Caption = Xplain(im_BEVEL)
End Sub
Sub itmBorders_Click(index As Integer)
'Sets border size for control
Dim iIndex As Integer
'Turn checks off
For iIndex = 0 To 2
itmBorders(iIndex).Checked = False
Next
'Makes selection and set appropriate check
Select Case index
Case im_NONE
Mh3dFrame1.BorderStyle = index
itmBorders(index).Checked = True
Case im_SINGLE
Mh3dFrame1.BorderStyle = index
itmBorders(index).Checked = True
Case im_ROUNDED
Mh3dFrame1.BorderStyle = index
itmBorders(index).Checked = True
End Select
lblXplain.Caption = Xplain(im_LEAD)
End Sub
Sub itmColor_Click(index As Integer)
'Routine calls up common color dialog so we can
'illustrate the color properties of the control.
'Note that we don't set .ForeColor or .BackColor
'even though they appear in the properties list.
'Changing them can cause bizarre color display and
'some controls may behave strangely. Leave those
'properties at their defaults
If index = 0 And Mh3dFrame1.BorderStyle = im_NONE Then
MsgBox "You must set Border Style to something other than none for this property to have any effect.", 16, "MicroHelp"
Exit Sub
End If
'Sets flag to prevent custom color palette from
'appearing, calls dialog and sets appropriate
'color property when dialog closes.
MhCommdl1.Flags = CC_PREVENTFULLOPEN
MhCommdl1.CancelError = True
On Error GoTo ColorError
MhCommdl1.Action = 3
Select Case index
Case im_BORDERCOLOR
Mh3dFrame1.BorderColor = MhCommdl1.Color
Case im_FILLCOLOR
Mh3dFrame1.FillColor = MhCommdl1.Color
Case im_LIGHTCOLOR
Mh3dFrame1.LightColor = MhCommdl1.Color
Case im_SHADOWCOLOR
Mh3dFrame1.ShadowColor = MhCommdl1.Color
Case im_TEXTCOLOR
Mh3dFrame1.TextColor = MhCommdl1.Color
End Select
lblXplain.Caption = Xplain(im_COLOR)
lblXplain.FillColor = Mh3dFrame1.FillColor
Exit Sub
ColorError:
Select Case index
Case im_BORDERCOLOR
Mh3dFrame1.BorderColor = im_BLACK
Case im_FILLCOLOR
Mh3dFrame1.FillColor = im_GRAY
Case im_LIGHTCOLOR
Mh3dFrame1.LightColor = im_WHITE
Case im_SHADOWCOLOR
Mh3dFrame1.ShadowColor = im_DARK_GRAY
Case im_TEXTCOLOR
Mh3dFrame1.TextColor = im_BLACK
End Select
Exit Sub
End Sub
Sub itmExit_Click()
'Dump form and end program
Unload fMh3dFrame
End
End Sub
Sub itmPix_Click(index As Integer)
'This routine places a picture in the frame area.
Dim iIndex As Integer
'Turn checks off
For iIndex = 0 To 3
itmPix(iIndex).Checked = False
Next
'Hide explanation label
lblXplain.Visible = False
'Place picture and check menu item
Select Case index
Case im_NONE
Mh3dFrame1.Picture = LoadPicture("")
itmPix(index).Checked = True
lblXplain.Visible = True
Case im_ATSIZE
Mh3dFrame1.Picture = Picture1.Picture
Mh3dFrame1.WallPaper = index - 1
itmPix(index).Checked = True
Case im_STRETCH
Mh3dFrame1.Picture = Picture1.Picture
Mh3dFrame1.WallPaper = index - 1
itmPix(index).Checked = True
Case im_REPLICATE
Mh3dFrame1.Picture = Picture1.Picture
Mh3dFrame1.WallPaper = index - 1
itmPix(index).Checked = True
End Select
End Sub
Sub mnuColors_Click()
'Show xplanation label if it's hidden
ShowXplain
End Sub
Sub mnuFile_Click()
'Show xplanation label if it's hidden
ShowXplain
End Sub
Sub mnuOptions_Click()
'Show xplanation label if it's hidden
ShowXplain
End Sub
Sub ShowXplain()
'Show explanation label if hidden
'and hide the picture
If lblXplain.Visible = False Then
Mh3dFrame1.Picture = LoadPicture("")
lblXplain.Visible = True
End If
End Sub
Function Xplain(choice As Integer)
Select Case choice
Case im_LEAD
Xplain = "MicroHelp's Mh3DFrame offers all the features of the Visual Basic frame plus added abilities that allow you to bind the frame to the database, provide a three-dimensional appearance to your application and control all other aspects of the control's appearance."
Case im_ALIGN
Xplain = "You can dynamically position the caption for the frame or even do away with it altogether. You also have complete control over the font style and characteristics of the caption."
Case im_BEVEL
Xplain = "Mh3DFrame gives the program a choice of five different bevel styles (as well as no bevel at all). You can alter the bevel at runtime if needed and control the colors of the pieces of the bevel as well."
Case im_COLOR
Xplain = "MicroHelp gives you total control over the colors of the Mh3DFrame. You can create traditional bevel effects or get as wild with your colors as you like. Even the color of the text can be highlighted"