VB中怎么把程序缩小到又下脚,怎么在激活

来源:百度知道 编辑:UC知道 时间:2024/05/15 15:14:02
VB中怎么把程序缩小到又下脚,怎么在激活

托盘图标吗?要用api函数,你把我以下的代码复制过去,然后在你的工程里增加一个tptb的模块,再修改你的主程序的Resize和unload事件就可以了:还有,m1是一个菜单,你从菜单设计器中设计一个一个菜单m1,然后使他不可见,用来作弹出菜单来使用.

'本模块为实现托盘图标的模块 , 他在主窗体的form_resize和 form_unload中存在,看以下例子.

'Private Sub Form_Resize()
'If Me.WindowState = vbMinimized Then
' If tptb.show_yes = False Then
' tptb.AddToTray Me, m1
' tptb.show_yes = True
' tptb.SetTrayTip "资料管理"
' End If
' Me.Hide
'End If
'If Me.WindowState = 0 Then Me.WindowState = 2
'End Sub

'Private Sub Form_Unload(Cancel As Integer)
' tptb.RemoveFromTray
'End Sub

Public show_yes As Boolean
Public OldWindowProc As Long
Private TheForm As Form
Private TheMenu As Menu
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer '声明外部函数,获得鼠标按键状态
Private Declare Sub mouse_event Lib "user3