如何去掉vb应用程序的标题栏

yjohnny 2003-10-21 09:41:29
如何去掉vb应用程序的标题栏
...全文
167 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
yulohan 2003-12-11
  • 打赏
  • 举报
回复
设置窗体模式为0,或者让contrelbox 为false
doudou8090 2003-10-22
  • 打赏
  • 举报
回复
BorderStyle的属性设置为0
watt 2003-10-22
  • 打赏
  • 举报
回复
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Const GWL_STYLE = (-16)
Const WS_CAPTION = &HC00000
Const WS_BORDER = &H800000

Private Sub MDIForm_Load()
Dim L As Long
L = GetWindowLong(Me.hwnd, GWL_STYLE)
L = L And Not (WS_BORDER) And Not (WS_CAPTION)
L = SetWindowLong(Me.hwnd, GWL_STYLE, L)
End Sub
给你一个掩藏MDI的代码。
weill 2003-10-22
  • 打赏
  • 举报
回复
哈哈,太容易了,这也不会哦:)。
把BorderStyle设为0
把Caption设为空就可以了。
northwolves 2003-10-22
  • 打赏
  • 举报
回复
以前写的代码:
'This sample show you how to cut the caption title exactly and create controls with code.
'add a new form ,do nothing but copy this codes for it.
Option Explicit
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal x1 As Long, ByVal y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private WithEvents cmd1 As CommandButton
Private WithEvents cmd2 As CommandButton
Private Sub cmd1_Click() '******************
Dim capheight As Long, area As Long
Me.ScaleMode = 2
Me.ForeColor = vbRed
Me.Line (1, 0)-(Me.Width, 0) '紧贴标题栏画线做标记
capheight = GetSystemMetrics(33) + GetSystemMetrics(4) ' 边框宽度+标题栏高度
area = CreateRectRgn(0, capheight, Me.Width, Me.Height) '画无标题栏的矩形框
area = SetWindowRgn(Me.hWnd, area, True) '裁剪标题栏
End Sub
Private Sub cmd2_Click() '*******************
Me.ScaleMode = 2
Dim area As Long
area = CreateRectRgn(0, 0, Me.Width, Me.Height) '画含标题栏的矩形框
area = SetWindowRgn(Me.hWnd, area, True) '恢复标题栏
End Sub
Private Sub Form_Load()
Me.WindowState = 0
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2, 8000, 5000'居中及设置窗体大小
Set cmd1 = Controls.Add("VB.CommandButton", "cmd1", Me)'添加cmd1按纽
Set cmd2 = Controls.Add("VB.CommandButton", "cmd2", Me)'添加cmd2按纽
cmd1.Move 1000, 1000, 1500, 500
cmd2.Move 3000, 1000, 1500, 500
cmd1.Caption = "裁剪标题栏"
cmd2.Caption = "恢复标题栏"
cmd1.Visible = True
cmd2.Visible = True
End Sub
telent 2003-10-22
  • 打赏
  • 举报
回复
contrelbox=false,caption=""
接分!
j4sxw 2003-10-22
  • 打赏
  • 举报
回复
BorderStyle的属性设置为0
守城小轩 2003-10-22
  • 打赏
  • 举报
回复
BorderStyle=0
shisanjin 2003-10-22
  • 打赏
  • 举报
回复
设置窗体模式为0.
djf1978 2003-10-21
  • 打赏
  • 举报
回复
将BorderStyle的属性设置为0
golden24kcn 2003-10-21
  • 打赏
  • 举报
回复
设置窗体模式为0,或者让contrelbox 为false

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧