home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / FYI__Trans2045151282007.psc / frmTF.frm < prev    next >
Text File  |  2007-01-28  |  9KB  |  306 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmTF 
  4.    Caption         =   "Form1"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   165
  7.    ClientTop       =   855
  8.    ClientWidth     =   5835
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   4845
  11.    ScaleWidth      =   5835
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.CheckBox chkStyle 
  14.       Caption         =   "No Caption"
  15.       Height          =   225
  16.       Index           =   1
  17.       Left            =   3900
  18.       TabIndex        =   13
  19.       Top             =   4590
  20.       Width           =   1425
  21.    End
  22.    Begin VB.CheckBox chkStyle 
  23.       Caption         =   "No Borders"
  24.       Height          =   210
  25.       Index           =   3
  26.       Left            =   4620
  27.       TabIndex        =   12
  28.       Top             =   3600
  29.       Width           =   1230
  30.    End
  31.    Begin VB.CheckBox chkStyle 
  32.       Caption         =   "Flat Borders"
  33.       Height          =   210
  34.       Index           =   2
  35.       Left            =   4605
  36.       TabIndex        =   9
  37.       Top             =   3825
  38.       Width           =   1335
  39.    End
  40.    Begin VB.CommandButton Command1 
  41.       Caption         =   "Do It"
  42.       Height          =   510
  43.       Index           =   0
  44.       Left            =   1020
  45.       TabIndex        =   8
  46.       Top             =   3855
  47.       Width           =   915
  48.    End
  49.    Begin VB.CommandButton Command1 
  50.       Caption         =   "Erase"
  51.       Height          =   510
  52.       Index           =   1
  53.       Left            =   90
  54.       TabIndex        =   7
  55.       Top             =   3855
  56.       Width           =   915
  57.    End
  58.    Begin VB.ComboBox cboAlign 
  59.       Height          =   315
  60.       ItemData        =   "frmTF.frx":0000
  61.       Left            =   1980
  62.       List            =   "frmTF.frx":0016
  63.       Style           =   2  'Dropdown List
  64.       TabIndex        =   6
  65.       Top             =   4050
  66.       Width           =   1815
  67.    End
  68.    Begin VB.CommandButton cmdColor 
  69.       Caption         =   "Text"
  70.       Height          =   330
  71.       Index           =   0
  72.       Left            =   3885
  73.       TabIndex        =   5
  74.       ToolTipText     =   "Change Caption Color"
  75.       Top             =   4035
  76.       Width           =   690
  77.    End
  78.    Begin VB.CommandButton cmdColor 
  79.       Caption         =   "Border"
  80.       Height          =   330
  81.       Index           =   1
  82.       Left            =   4575
  83.       TabIndex        =   4
  84.       ToolTipText     =   "Change Border Color"
  85.       Top             =   4035
  86.       Width           =   690
  87.    End
  88.    Begin VB.CheckBox chkStyle 
  89.       Caption         =   "Flat Caption"
  90.       Height          =   210
  91.       Index           =   0
  92.       Left            =   3900
  93.       TabIndex        =   3
  94.       Top             =   4365
  95.       Value           =   1  'Checked
  96.       Width           =   1425
  97.    End
  98.    Begin VB.Frame Frame1 
  99.       Caption         =   "VB Frame"
  100.       Height          =   1890
  101.       Left            =   150
  102.       TabIndex        =   2
  103.       Top             =   315
  104.       Width           =   1425
  105.    End
  106.    Begin VB.PictureBox Picture1 
  107.       Height          =   1890
  108.       Left            =   1965
  109.       ScaleHeight     =   122
  110.       ScaleMode       =   3  'Pixel
  111.       ScaleWidth      =   233
  112.       TabIndex        =   0
  113.       Top             =   315
  114.       Width           =   3555
  115.       Begin VB.Label Label2 
  116.          Caption         =   "^ Image is on the frame"
  117.          Height          =   270
  118.          Left            =   1275
  119.          TabIndex        =   1
  120.          Top             =   1395
  121.          Width           =   1755
  122.       End
  123.       Begin VB.Image Image1 
  124.          Height          =   900
  125.          Left            =   165
  126.          Picture         =   "frmTF.frx":006F
  127.          Top             =   375
  128.          Width           =   2100
  129.       End
  130.    End
  131.    Begin MSComDlg.CommonDialog dlgColor 
  132.       Left            =   4050
  133.       Top             =   3015
  134.       _ExtentX        =   847
  135.       _ExtentY        =   847
  136.       _Version        =   393216
  137.       CancelError     =   -1  'True
  138.    End
  139.    Begin VB.Label Label1 
  140.       BackColor       =   &H00C0FFC0&
  141.       Caption         =   "Label is behind the frame"
  142.       Height          =   255
  143.       Left            =   3660
  144.       TabIndex        =   11
  145.       Top             =   1215
  146.       Width           =   2520
  147.    End
  148.    Begin VB.Image Image2 
  149.       Height          =   1260
  150.       Left            =   1770
  151.       Picture         =   "frmTF.frx":1CBB
  152.       Top             =   1560
  153.       Width           =   915
  154.    End
  155.    Begin VB.Label Label3 
  156.       Caption         =   "< Image is behind the frame"
  157.       Height          =   285
  158.       Left            =   2565
  159.       TabIndex        =   10
  160.       Top             =   2415
  161.       Width           =   2040
  162.    End
  163.    Begin VB.Image imgBkg 
  164.       Height          =   3840
  165.       Left            =   5445
  166.       Picture         =   "frmTF.frx":BF80
  167.       Top             =   4155
  168.       Visible         =   0   'False
  169.       Width           =   3840
  170.    End
  171.    Begin VB.Menu mnuPic 
  172.       Caption         =   "Picture"
  173.       Begin VB.Menu mnuPicPop 
  174.          Caption         =   "Show Sample Background Image"
  175.          Index           =   0
  176.       End
  177.       Begin VB.Menu mnuPicPop 
  178.          Caption         =   "Remove Sample Background Image"
  179.          Index           =   1
  180.       End
  181.    End
  182.    Begin VB.Menu mnuPopup 
  183.       Caption         =   "mnuPopup"
  184.       Visible         =   0   'False
  185.       Begin VB.Menu mnuColors 
  186.          Caption         =   "Shadow Color"
  187.          Index           =   0
  188.       End
  189.       Begin VB.Menu mnuColors 
  190.          Caption         =   "HighLight Color"
  191.          Index           =   1
  192.       End
  193.    End
  194. End
  195. Attribute VB_Name = "frmTF"
  196. Attribute VB_GlobalNameSpace = False
  197. Attribute VB_Creatable = False
  198. Attribute VB_PredeclaredId = True
  199. Attribute VB_Exposed = False
  200. Option Explicit
  201.  
  202. Private cColors(0 To 3) As Long
  203. Private c_TransFrame As cTransParentFrame
  204.  
  205. Private Sub chkStyle_Click(Index As Integer)
  206.     If chkStyle(Index).Value = 1 Then
  207.         If Index > 1 Then
  208.             If Index = 2 Then Index = 3 Else Index = 2
  209.             chkStyle(Index).Value = 0
  210.             cmdColor(1).Enabled = (Index <> 2)
  211.         Else
  212.             chkStyle(Abs(Index - 1)).Value = 0
  213.             cmdColor(0).Enabled = (Index = 0)
  214.         End If
  215.     End If
  216. End Sub
  217.  
  218. Private Sub cmdColor_Click(Index As Integer)
  219.  
  220.     mnuColors(1).Enabled = (chkStyle(Index).Value = 0)
  221.     mnuPopup.Tag = Index * 2
  222.     If mnuColors(1).Enabled Then
  223.         PopupMenu mnuPopup
  224.     Else
  225.         Call mnuColors_Click(0)
  226.     End If
  227.  
  228. End Sub
  229.  
  230. Private Sub Command1_Click(Index As Integer)
  231.     If Index = 0 Then
  232.         
  233.         With c_TransFrame
  234.             If chkStyle(2) = 1 Then
  235.                 .BorderStyle = tbpFlat
  236.             ElseIf chkStyle(3) = 1 Then
  237.                 .BorderStyle = tbpNone
  238.             Else
  239.                 .BorderStyle = tbp3D
  240.             End If
  241.             .FlatCaption = (chkStyle(0).Value = 1)
  242.             .SetTextColors cColors(0), cColors(1)
  243.             .SetBorderColors cColors(2), cColors(3)
  244.             .Align = cboAlign.ListIndex
  245.             
  246.             If chkStyle(1) = 1 Then
  247.                 .Caption = vbNullString
  248.             Else
  249.                 .Caption = "Transparent Frame"
  250.             End If
  251.             
  252.         End With
  253.         c_TransFrame.Refresh
  254.         
  255.     Else
  256.     
  257.         Set Picture1.Picture = Nothing
  258.         Picture1.Cls
  259.         
  260.     End If
  261. End Sub
  262.  
  263. Private Sub Form_Load()
  264.  
  265.     Picture1.BorderStyle = 0
  266.     cboAlign.ListIndex = 0
  267.     cColors(0) = -1     ' initialize to class' Render optional parameters
  268.     cColors(1) = -1
  269.     cColors(2) = -1
  270.     cColors(3) = -1
  271.     
  272.     Set c_TransFrame = New cTransParentFrame
  273.     c_TransFrame.Attach Picture1
  274.     c_TransFrame.Caption = "Transparent Frame"
  275.     
  276. End Sub
  277.  
  278. Private Sub mnuColors_Click(Index As Integer)
  279.  
  280.     With dlgColor
  281.         If cColors(Val(mnuPopup.Tag) + Index) = -1 Then
  282.             .Color = Picture1.ForeColor
  283.         Else
  284.             .Color = cColors(Val(mnuPopup.Tag) + Index)
  285.         End If
  286.         .Flags = cdlCCRGBInit
  287.     End With
  288.     On Error GoTo ExitRoutine
  289.     dlgColor.ShowColor
  290.     
  291.     cColors(Val(mnuPopup.Tag) + Index) = dlgColor.Color
  292.     
  293. ExitRoutine:
  294.  
  295. End Sub
  296.  
  297. Private Sub mnuPicPop_Click(Index As Integer)
  298.     If Index = 0 Then
  299.         Set Me.Picture = imgBkg.Picture
  300.     Else
  301.         Set Me.Picture = Nothing
  302.     End If
  303.         c_TransFrame.Refresh
  304. End Sub
  305.  
  306.