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

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

键盘上的舞指

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值