个人助手界面的实现VB源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
VERSION 5.00
Begin VB.Form MsgForm
BorderStyle = 0 'None
ClientHeight = 2115
ClientLeft = 9570
ClientTop = 2310
ClientWidth = 4545
ControlBox = 0 'False
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 2115
ScaleWidth = 4545
ShowInTaskbar = 0 'False
Begin VB.PictureBox picOptions
AutoRedraw = -1 'True
BorderStyle = 0 'None
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 300
Index = 0
Left = 150
ScaleHeight = 20
ScaleMode = 3 'Pixel
ScaleWidth = 64
TabIndex = 2
Top = 1665
Width = 960
End
Begin VB.PictureBox picIcon
AutoRedraw = -1 'True
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 75
ScaleHeight = 435
ScaleWidth = 495
TabIndex = 1
Top = 165
Width = 555
End
Begin VB.Label msgText
BackStyle = 0 'Transparent
Caption = "我能为您做点什么?"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1185
Left = 675
TabIndex = 0
Top = 270
Width = 3630
WordWrap = -1 'True
End
End
Attribute VB_Name = "MsgForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private BkColor As Variant
Private FrColor As Variant
Private CurIcon As Long
Private ButnTxt() As String
Private LastBtnUp As Integer
Public Sub A_SetBackColor(sBackColor As OLE_COLOR)
BkColor = sBackColor
End Sub
Public Sub A_Initialize()
Dim xCount As Integer
For xCount = 0 To picOptions.Count - 1
picOptions(xCount).BackColor = BkColor
picOptions(xCount).ForeColor = msgText.ForeColor
picOptions(xCount).FontName = msgText.FontName
picOptions(xCount).ForeColor = msgText.ForeColor
rg.Draw3dUp picOptions(xCount), ButnTxt(xCount)
Next
DoEvents
Me.Refresh
End Sub
Private Sub Form_Deactivate()
Me.Hide
End Sub
Private Sub Form_Load()
Me.BackColor = BkColor
Me.Refresh
picIcon.BackColor = BkColor
picIcon.Refresh
picIcon.BorderStyle = 0
Dim lRet As Long
Dim dl As Long
Dim MeWidth As Long
Dim MeHeight As Long
MeWidth = Me.Width / Screen.TwipsPerPixelX
MeHeight = Me.Height / Screen.TwipsPerPixelY
'Create Form with Rounded Corners
lRet = CreateRoundRectRgn(0, 0, MeWidth, MeHeight, 20, 20)
dl = SetWindowRgn(Me.hWnd, lRet, True)
End Sub
Private Sub Form_LostFocus()
Me.Hide
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload MsgForm
End Sub
Private Sub picOptions_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
rg.Draw3dDown picOptions(Index), ButnTxt(Index)
End Sub
Private Sub picOptions_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
rg.Draw3dUp picOptions(Index), ButnTxt(Index)
Me.Hide
Me.Hide
DoEvents
Unload frmAssist
End Sub
Public Property Let A_MsgText(ByVal vNewValue As String)
msgText = vNewValue
End Property
Public Property Let A_SystemIcon(vNewValue As SystemIcons)
Call rg.picGetSysMsgBoxIcon(picIcon, vNewValue)
End Property
Public Sub A_AddButton(BtnIndex As Integer, BtnText As String)
If BtnIndex = 0 Then
ReDim ButnTxt(0)
ButnTxt(0) = BtnText
Else
ReDim Preserve ButnTxt(UBound(ButnTxt) + 1)
ButnTxt(UBound(ButnTxt)) = BtnText
Load picOptions(BtnIndex)
picOptions(BtnIndex).Left = picOptions(BtnIndex - 1).Left + picOptions(BtnIndex - 1).Width + 60
picOptions(BtnIndex).Top = picOptions(BtnIndex - 1).Top
picOptions(BtnIndex).Visible = True
End If
End Sub