如何屏蔽标题栏?

xiangxi97 2004-07-23 04:54:03
如何屏蔽标题栏,包括最大化、最小化、关闭等按钮,就是让上面那一行蓝条消失?请哪位告诉本人一下,多谢!
...全文
73 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiangxi97 2004-07-23
  • 打赏
  • 举报
回复
行啦,二楼朋友写那么,本人根本看不懂了!还是多谢好意!
xiangxi97 2004-07-23
  • 打赏
  • 举报
回复
不会吧,这么简单!我真白痴!哈!多谢!
zcm123 2004-07-23
  • 打赏
  • 举报
回复
BorderStyle=0

若自己想要令定义一个 自造的窗体的话 那就 参照如下实例

' Unique Form Example - Written completely by Grayda
' firestorm.stormynight.net

' This code shows you how to create cool looking forms to use in your application
' No OCXs are required, and only one form with minimal coding. Please vote, coz I
' need em! :)

' You may use this code, and modify it, as long as you give me lots of credit for it :)

' This declaration allows us to click on and hold onto our title bar or corners for resize (Even if they aren't present)
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
' Lets go of the titlebar or corners
Private Declare Sub ReleaseCapture Lib "user32" ()
' Constant for mouse down
Const WM_NCLBUTTONDOWN = &HA1
' Our titlebar
Const WCAPTION = 2
' The South-Eastern corner of our form, for resizing
Const W_SE_RESIZE = 17

Private Sub Form_Resize()
' Positions the label at 0,0 and spans the entire form
Label1.Move 0, 0, Me.Width
' Positions our information in the center
Label2.Move Me.Width / 2 - Label2.Width / 2, Me.Height / 2 - Label2.Height / 2
' Label3 is our resize button. This code places it in the corner
Label3.Move Me.Width - Label3.Width, Me.Height - Label3.Height
' Label4 is our close button. Slaps it at the end of our form (up the top)
Label4.Move Me.Width - Label4.Width - 100
' Label5 is the minimize button
Label5.Move Me.Width - Label5.Width - Label4.Width - Label6.Width - 150
' Label6 is the maximize and restore button
Label6.Move Me.Width - Label4.Width - 450
End Sub

Private Sub Label1_DblClick()
' When you double click on a form title, it will maximize. This does the same thing
Label6_Click
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' Grabs onto our form's titlebar. If you want the focus to follow the mouse, then take away the
' if button = 1 if statement
If Button = 1 Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, WCAPTION, 0&
End If
End Sub


Private Sub Label3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
' This code grabs onto our resize bars and resizes the form. Try replacing W_SE_RESIZE with a
' number between 10 and 17 to see the resizing effects
If Button = 1 Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, W_SE_RESIZE, 0&
End If
End Sub


Private Sub Label4_Click()
End
End Sub

Private Sub Label5_Click()
' Minimize the form
Me.WindowState = 1
End Sub

Private Sub Label6_Click()
' Is it maximized? If so, then return it to normal. Else maximize it
If WindowState <> 2 Then
Me.WindowState = 2
Else
WindowState = 0
End If
End Sub
xuboying 2004-07-23
  • 打赏
  • 举报
回复
设置BorderStyle=0就可以了
不过
这样就不可以用菜单了,想用菜单的话
设置ControlBox=false
并且让Caption=""

7,763

社区成员

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

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