📄 frmadd3.frm
字号:
VERSION 5.00
Begin VB.Form frmadd3
BackColor = &H00F4F5F6&
BorderStyle = 0 'None
Caption = "增加信息"
ClientHeight = 4275
ClientLeft = 0
ClientTop = 0
ClientWidth = 6690
LinkTopic = "Form1"
MDIChild = -1 'True
Picture = "frmadd3.frx":0000
ScaleHeight = 4252.85
ScaleMode = 0 'User
ScaleWidth = 6675
ShowInTaskbar = 0 'False
Begin VB.TextBox Text1
Height = 270
Left = 6720
TabIndex = 0
Text = "Text1"
Top = 1200
Width = 180
End
Begin VB.Timer mousemovetimer
Enabled = 0 'False
Interval = 10
Left = 120
Top = 3720
End
Begin VB.ComboBox obj_term
Appearance = 0 'Flat
BackColor = &H00F4F5F6&
Height = 300
ItemData = "frmadd3.frx":14E10
Left = 1800
List = "frmadd3.frx":14E1D
Style = 2 'Dropdown List
TabIndex = 2
Top = 2211
Width = 1575
End
Begin VB.TextBox obj_name
Appearance = 0 'Flat
BackColor = &H00F4F5F6&
BorderStyle = 0 'None
Height = 221
Left = 1824
TabIndex = 1
Top = 1829
Width = 2055
End
Begin VB.Image mousermovepic
Height = 345
Left = 0
Picture = "frmadd3.frx":14E3F
Top = 0
Width = 6270
End
Begin VB.Image tbutton2
Height = 210
Left = 1440
Top = 1080
Width = 960
End
Begin VB.Image tbutton1
Height = 210
Left = 480
Top = 1080
Width = 960
End
Begin VB.Image pic_exit
Height = 285
Left = 5160
Picture = "frmadd3.frx":1A271
Top = 3780
Width = 1065
End
Begin VB.Image pic_ok
Height = 285
Left = 3840
Picture = "frmadd3.frx":1B2BD
Top = 3780
Width = 1065
End
Begin VB.Image pic_close
Height = 180
Left = 6360
Picture = "frmadd3.frx":1C309
Top = 120
Width = 180
End
End
Attribute VB_Name = "frmadd3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim oldx As Integer '为解决全图形窗口没有标题栏而无法拖动的问题而定义的鼠标新旧两个XY变量
Dim oldy As Integer
Dim newx As Integer
Dim newy As Integer
'>>>>>>>>>>>>>>>>>>>>>>>>以下程序段解决全图形窗口的移动问题<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'移植须知:将该功能移植到一个全图片窗口以解决不能移动的问题时,需注意:1 赋值计时器和伪装标题栏到新的全图片窗体中;2 赋值定义的新旧XY值(4个)和本程序段到新的全图片窗体中;3 修改计时器的过程“mousemovetimer_Timer”中的四个窗体名字。4 修改伪装标题栏的图片
'当指定图片(伪装标题栏)被鼠标点击时启动计时器,并记录下当时的初始鼠标坐标
Private Sub mousermovepic_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
mousemovetimer.Enabled = True
oldx = X
oldy = Y
End Sub
'当指定图片(伪装标题栏)上鼠标移动时,赋给新的鼠标XY值,注意系统每隔很短的时间会赋值一次。
Private Sub mousermovepic_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
newx = X
newy = Y
End Sub
'当指定图片(伪装标题栏)被鼠标释放时关闭计时器。
Private Sub mousermovepic_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
mousemovetimer.Enabled = False
End Sub
'计时器将定时得到四个值,分别是固定的初始XY值,和不断变化的新的XY值。利用新旧XY的差,可以以此来移动窗体。适当调小计时器间隔时间将有助于移动窗体的流畅性。
Private Sub mousemovetimer_Timer()
frmadd3.Left = frmadd3.Left - (oldx - newx)
If frmadd3.Top - (oldy - newy) < 500 Then
frmadd3.Top = 500
Else
frmadd3.Top = frmadd3.Top - (oldy - newy)
End If
End Sub
'>>>>>>>>>>>>>>>>>>>>>>>>以上程序段解决全图形窗口的移动问题<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'>>>>>>>>>>>>>>>>>切换功能程序段<<<<<<<<<<<<<<<<<<
Private Sub tbutton1_Click()
frmadd1.Top = Me.Top
frmadd1.Left = Me.Left
Unload Me
End Sub
Private Sub tbutton2_Click()
frmadd2.Top = Me.Top
frmadd2.Left = Me.Left
Unload Me
End Sub
'>>>>>>>>>>>>>>>>>切换功能程序段<<<<<<<<<<<<<<<<<<
'初始化窗体
Private Sub Form_Load()
frmmain.addwindowsishas = True '加载时布尔值为真,这样在再次点击添加数据按钮或菜单时,不会出现第二个添加窗口“frmadd1”了
obj_name.Text = ""
obj_term.ListIndex = 0
End Sub
'关闭按钮实现
Private Sub pic_close_Click()
frmmain.addwindowsishas = False '还原布尔值
Unload Me
End Sub
'退出按钮实现
Private Sub pic_exit_Click()
frmmain.addwindowsishas = False '还原布尔值
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -