|
-
Oct 23rd, 2001, 11:51 AM
#1
Thread Starter
Addicted Member
API Call To Change BorderStyle
Is there an API call to change the border style of a window to the none state (0) and the bordered state (2)? I've tried using:
Me.BorderStyle = 0
But, you can't change a read-only property at runtime. So could someone post the API calls for doing the above? Thanking you in advance...
100 posts... All of them have been "How Do I's", "Can You's", "HELP ME!!'s"...
Still, at least they've been relevant..
-
Oct 23rd, 2001, 12:51 PM
#2
VB Code:
Option Explicit
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
Private Const GWL_STYLE = (-16)
Private Const WS_BORDER = &H800000
Private Sub Command1_Click()
Dim lngStyle As Long
lngStyle = GetWindowLong(Form1.hwnd, GWL_STYLE) And (Not WS_BORDER)
Call SetWindowLong(Form1.hwnd, GWL_STYLE, lngStyle)
Form1.WindowState = vbMinimized
Form1.WindowState = vbNormal
End Sub
-
Oct 23rd, 2001, 01:08 PM
#3
Thread Starter
Addicted Member
Is that the coding to make the window have a border or to borderless? And if both, how do I make a distinction between the two?
100 posts... All of them have been "How Do I's", "Can You's", "HELP ME!!'s"...
Still, at least they've been relevant..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|