Form1.frm
上传用户:nikelister
上传日期:2022-05-09
资源大小:6k
文件大小:3k
源码类别:

图形图像处理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   2760
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   2400
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   2760
  10.    ScaleWidth      =   2400
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.Frame Frame2 
  13.       BackColor       =   &H00FFFF80&
  14.       Caption         =   "Frame2"
  15.       Height          =   1215
  16.       Left            =   120
  17.       TabIndex        =   1
  18.       Top             =   1440
  19.       Width           =   2175
  20.       Begin VB.Label Label1 
  21.          Alignment       =   2  'Center
  22.          BackStyle       =   0  'Transparent
  23.          Caption         =   "Default Behavior"
  24.          Height          =   255
  25.          Index           =   1
  26.          Left            =   120
  27.          TabIndex        =   3
  28.          Top             =   480
  29.          Width           =   1935
  30.       End
  31.    End
  32.    Begin VB.Frame Frame1 
  33.       BackColor       =   &H0080FF80&
  34.       Caption         =   "Frame1"
  35.       Height          =   1215
  36.       Left            =   120
  37.       TabIndex        =   0
  38.       Top             =   120
  39.       Width           =   2175
  40.       Begin VB.Label Label1 
  41.          Alignment       =   2  'Center
  42.          BackStyle       =   0  'Transparent
  43.          Caption         =   "Fixed With Routine"
  44.          Height          =   255
  45.          Index           =   0
  46.          Left            =   120
  47.          TabIndex        =   2
  48.          Top             =   480
  49.          Width           =   1935
  50.       End
  51.       Begin VB.Shape Shape1 
  52.          Height          =   375
  53.          Left            =   120
  54.          Top             =   240
  55.          Width           =   1095
  56.       End
  57.    End
  58. End
  59. Attribute VB_Name = "Form1"
  60. Attribute VB_GlobalNameSpace = False
  61. Attribute VB_Creatable = False
  62. Attribute VB_PredeclaredId = True
  63. Attribute VB_Exposed = False
  64. Option Explicit
  65. 'Rob Crombie (a VBClassic supporter)
  66. 'Change the Backcolor of a frame, and be able to hide the ugly area above the frame border.
  67. 'This will correct that area to match the backcolor of the frame's container
  68. 'Just place a shape within the frame, and call the Sub
  69. Public Sub HideTheUglyTopOfFrame(cFrame As Frame, cShape As Shape, Optional FillColor As Long = -1)
  70.     'Sorry, but I must set the frame's Font (as it affects the size of the area above the top border)
  71.     cFrame.Font = "MS Sans Serif"
  72.     cFrame.FontBold = False
  73.     cFrame.FontSize = 8
  74.     cFrame.Caption = ""   'Place your own descriptive Label within the Frame, instead.
  75.     
  76.     With cShape
  77.         .BackStyle = 1   'Opaque
  78.         .BorderStyle = 0 'Transparent
  79.         .Height = 105
  80.         .Left = 0
  81.         .Top = 0
  82.         .Width = cFrame.Width + 300  'To avoid slight lack of (right) coverage on larger frames.
  83.         If FillColor = -1 Then
  84.             .BackColor = cFrame.Parent.BackColor
  85.         Else
  86.             'Caller must have the frame in non Form container, and has passed me it's backcolor
  87.             .BackColor = FillColor
  88.         End If
  89.     End With
  90. End Sub
  91. Private Sub Form_Load()
  92.     HideTheUglyTopOfFrame Frame1, Shape1
  93. End Sub