frmFloatFavorite.frm
资源名称:IE_VB.rar [点击查看]
上传用户:davilee3
上传日期:2015-04-22
资源大小:986k
文件大小:4k
源码类别:
浏览器
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form frmFloatFavorite
- BorderStyle = 5 'Sizable ToolWindow
- ClientHeight = 4695
- ClientLeft = 60
- ClientTop = 1125
- ClientWidth = 2640
- ControlBox = 0 'False
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4695
- ScaleWidth = 2640
- ShowInTaskbar = 0 'False
- Begin VB.PictureBox pctMove
- BorderStyle = 0 'None
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000009&
- Height = 240
- Left = 0
- ScaleHeight = 240
- ScaleWidth = 1575
- TabIndex = 0
- Top = 0
- Width = 1575
- End
- Begin VB.Menu mnuALPHA
- Caption = "透明度"
- Visible = 0 'False
- Begin VB.Menu mnuALPHA_ss
- Caption = ""
- Index = 0
- End
- End
- End
- Attribute VB_Name = "frmFloatFavorite"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private mShowALPHAMenu As Boolean
- Private m_isActive As Boolean
- Public Sub resizeFramFravorite(oParent As MDIFrmMain)
- On Error Resume Next
- With oParent
- .pctHoldFavorite.Left = 0
- .pctHoldFavorite.Top = 0
- .pctHoldFavorite.Width = Me.ScaleWidth
- .pctHoldFavorite.Height = Me.ScaleHeight
- ' If Not .m_cTbrSidebar Is Nothing Then
- ' Call .m_cTbrSidebar.MoveToolbar( _
- ' .pctHoldFavorite.Width / 15 - .m_cTbrSidebar.GetToolbarWidth, _
- ' 0, 0, 0, False, True)
- ' Call .m_cTvwFav.Move(0, .m_cTbrSidebar.GetToolbarHeight, _
- ' Me.ScaleWidth / 15, _
- ' Me.ScaleHeight / 15 - .m_cTbrSidebar.GetToolbarHeight)
- ' End If
- pctMove.Width = .pctHoldFavorite.Width - .m_cTbrSidebar.GetToolbarWidth * 15
- pctMove.Height = .m_cTbrSidebar.GetToolbarHeight * 15
- End With
- pctMove.ZOrder
- End Sub
- Private Sub Form_Activate()
- m_isActive = True
- pctMove.Refresh
- End Sub
- Private Sub Form_Deactivate()
- m_isActive = False
- pctMove.Refresh
- End Sub
- Private Sub Form_Initialize()
- mShowALPHAMenu = IsWin2k
- m_isActive = False
- End Sub
- Private Sub Form_Load()
- Dim i&
- For i = 1 To 10
- Load mnuALPHA_ss(i)
- mnuALPHA_ss(i).Caption = LTrim(Str((11 - i) * 10)) & "%"
- mnuALPHA_ss(i).Visible = True
- Next i
- mnuALPHA_ss(1).Checked = True
- mnuALPHA_ss(0).Visible = False
- End Sub
- Private Sub Form_Resize()
- If FloatFavorite = 0 Then
- Call resizeFramFravorite(gMainForm)
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- If Not isExit Then
- gMainForm.ShowFavorite = 0 ' tbrUnpressed
- Cancel = 1
- End If
- End Sub
- Private Sub mnuALPHA_ss_Click(index As Integer)
- Dim i&, tAl&
- For i = 1 To 10
- mnuALPHA_ss(i).Checked = False
- Next i
- mnuALPHA_ss(index).Checked = True
- tAl = CLng((11 - index) * 25.5)
- SetWindowLong Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED
- SetLayeredWindowAttributes Me.hWnd, 0, tAl, LWA_ALPHA
- End Sub
- Private Sub pctMove_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
- If Button = vbLeftButton Then
- Call ReleaseCapture
- Call SendMessage(Me.hWnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0)
- ElseIf Button = vbRightButton Then
- If mShowALPHAMenu Then
- Me.PopupMenu mnuALPHA, vbPopupMenuRightButton
- End If
- End If
- End Sub
- Private Sub pctMove_Paint()
- Dim r As RECT
- SetRect r, 0, 0, pctMove.Width / 15, pctMove.Height / 15
- pctMove.Cls
- If m_isActive Then
- DrawCaption Me.hWnd, pctMove.hdc, r, DC_ACTIVE Or DC_GRADIENT Or DC_ICON Or DC_TEXT
- Else
- DrawCaption Me.hWnd, pctMove.hdc, r, DC_NOTACTIVE Or DC_GRADIENT Or DC_ICON Or DC_TEXT
- End If
- pctMove.CurrentX = 30: pctMove.CurrentY = 30
- pctMove.Print "收藏夹"
- End Sub