本文主要是介绍VB运行后去除窗体标题栏且可改变窗口大小及移动窗体,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
VB去除标题栏(黑边可设)+改变窗体大小+移动窗体
窗体调用模块的代码如下:
Option Explicit
'最大化及还原
Private Sub Maximize()
If Beautify.FWindowState = False Then
Beautify.FWindowState = True
Me.Move 0, 0, Screen.Width, Screen.Height - TaskbarHeight
Else
Beautify.FWindowState = False
Me.Move Beautify.Fmove(0), Beautify.Fmove(1), Beautify.Fmove(2), Beautify.Fmove(3)
End If
End Sub
Private Sub Combut_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Screen.MousePointer = 0
End Sub
Private Sub Combut_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button <> 1 Then Exit Sub
If Index = 0 Then
End
ElseIf Index = 1 Then
Call Maximize
ElseIf Index = 2 Then
Me.WindowState = 1
End If
End Sub
Private Sub Form_DblClick() '鼠标左键双击窗体时执行最大化和还原
If Jpzj = 1 Then Call Maximize
End Sub
Private Sub Form_Load()
Me.Caption = “VB去除标题栏+改变大小+移动窗体”
Combut(0).Caption = “×”
Combut(1).Caption = “□”
Combut(2).Caption = “▂”
Call Beautify.NoTitleBar(Me, 1) '去除标题栏
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Jpzj = Button '获取鼠标左键事件
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call Beautify.MoveMe(Button, X, Y) '改变窗口大小
End Sub
Private Sub Form_Resize()
Combut(0).Move (Me.ScaleWidth - Combut(0).Width) - 100, 100, 300, 300
Combut(1).Move (Combut(0).Left - Combut(1).Width) - 50, 100, 300, 300
Combut(2).Move (Combut(1).Left - Combut(2).Width) - 50, 100, 300, 300
Label1.Caption = Me.Caption: Label1.FontSize = 15: Label1.AutoSize = True
Label1.Move (Me.ScaleWidth - Label1.Width) / 2, (Me.ScaleHeight - Label1.Height) / 2
If Me.WindowState = 1 Or Me.WindowState = 2 Then Exit Sub
Select Case True
Case Me.Width > Screen.Width
Me.Width = Screen.Width
Case Me.Width < 5000
Me.Width = 5000
Case Me.Height > Screen.Height
Me.Height = Screen.Height
Case Me.Height < 3000
Me.Height = 3000
End Select
End Sub
.
.
.
.
.
.
.
.
.
.
工程包下载地址:https://download.csdn.net/download/ty5858/15057473
这篇关于VB运行后去除窗体标题栏且可改变窗口大小及移动窗体的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!