Form1.frm
上传用户:nikelister
上传日期:2022-05-09
资源大小:6k
文件大小:3k
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 2760
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 2400
- LinkTopic = "Form1"
- ScaleHeight = 2760
- ScaleWidth = 2400
- StartUpPosition = 3 'Windows Default
- Begin VB.Frame Frame2
- BackColor = &H00FFFF80&
- Caption = "Frame2"
- Height = 1215
- Left = 120
- TabIndex = 1
- Top = 1440
- Width = 2175
- Begin VB.Label Label1
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "Default Behavior"
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 3
- Top = 480
- Width = 1935
- End
- End
- Begin VB.Frame Frame1
- BackColor = &H0080FF80&
- Caption = "Frame1"
- Height = 1215
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 2175
- Begin VB.Label Label1
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- Caption = "Fixed With Routine"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 2
- Top = 480
- Width = 1935
- End
- Begin VB.Shape Shape1
- Height = 375
- Left = 120
- Top = 240
- Width = 1095
- End
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- 'Rob Crombie (a VBClassic supporter)
- 'Change the Backcolor of a frame, and be able to hide the ugly area above the frame border.
- 'This will correct that area to match the backcolor of the frame's container
- 'Just place a shape within the frame, and call the Sub
- Public Sub HideTheUglyTopOfFrame(cFrame As Frame, cShape As Shape, Optional FillColor As Long = -1)
- 'Sorry, but I must set the frame's Font (as it affects the size of the area above the top border)
- cFrame.Font = "MS Sans Serif"
- cFrame.FontBold = False
- cFrame.FontSize = 8
- cFrame.Caption = "" 'Place your own descriptive Label within the Frame, instead.
-
- With cShape
- .BackStyle = 1 'Opaque
- .BorderStyle = 0 'Transparent
- .Height = 105
- .Left = 0
- .Top = 0
- .Width = cFrame.Width + 300 'To avoid slight lack of (right) coverage on larger frames.
- If FillColor = -1 Then
- .BackColor = cFrame.Parent.BackColor
- Else
- 'Caller must have the frame in non Form container, and has passed me it's backcolor
- .BackColor = FillColor
- End If
- End With
- End Sub
- Private Sub Form_Load()
- HideTheUglyTopOfFrame Frame1, Shape1
- End Sub