初学,有这么个问题请网友帮助解决
'窗体:
Private Sub Form_Load()
Me.Caption = "测试"
'Me.Height = 500 * 15
'Me.Width = 150 * 15
If Timer1.Interval = 0 Then
Command2.Caption = "固定"
Else
Command2.Caption = "活动"
End If
End Sub
Private Sub Timer1_Timer()
Dim mous As POINTAPI
Call GetCursorPos(mous)
Label1.Caption = "鼠标X:" + Str(mous.x)
Label2.Caption = "鼠标X:" + Str(mous.y)
Label3.Caption = "窗口Top:" + Str(Me.Top / 15)
Label4.Caption = "窗口Left:" + Str(Me.Left / 15)
Label5.Caption = "窗口Height+Top:" + Str(Me.Top / 15 + Me.Height / 15)
Label6.Caption = "窗口Left+Width:" + Str(Me.Left / 15 + Me.Width / 15)
If mous.x > Me.Left / 15 And mous.x < Me.Width / 15 + Me.Left / 15 And mous.y > Me.Top / 15 And mous.y < Me.Height / 15 + Me.Top / 15 Then
Label7.Caption = "鼠标已经处于窗口内"
Me.Height = 500 * 15
Else
If Me.Top < 10 * 15 Then Me.Top = 0
If Me.Left < 10 * 15 Then Me.Left = 0
If Me.Top + Me.Height > 590 * 15 Then Me.Top = 600 * 15
If Me.Left + Me.Width > 790 * 15 Then Me.Left = 800 * 15
Label7.Caption = "鼠标未处于窗口内"
Me.Height = 3 * 15
End If
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub Command2_Click()
If Timer1.Interval = 0 Then
Timer1.Interval = 1
Command2.Caption = "活动"
Else
Timer1.Interval = 0
Command2.Caption = "固定"
End If
End Sub
'模块:
Type POINTAPI
x As Long
y As Long
End Type
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
问题:
1、如果要控制栏(ControlBox)或Caption不为空则窗体无法缩为最小(有一兰条)。
如果不要控制栏(ControlBox)或Caption不为空则窗体无法移动。
2、按上面的程序动行时,当窗体被移到屏幕右边时,窗体消失,屏幕下方有图标。但满屏幕找不到窗体在哪。它躲到哪儿去了?怎么找他出来?如何能消除这种情况?
3、我想编个仿OICQ的窗口,窗体里的组(就是那些灰色的横条按钮啦)是怎么做出来的?
那些元素又是怎么加进去的呢?(我想编一个小程序,把常用的网址分类放进去。上网时用着方便,并且不会碍事)请各位网友帮忙。先谢了。