|
-
May 18th, 2001, 01:06 AM
#1
Disable form moving
Simply: how can I do that?
(and I want to have titlebar and an icon and close button in it)
Thanks for any help,
-
May 18th, 2001, 06:10 AM
#2
Set the Form's Moveable property to False.
-
May 18th, 2001, 06:11 AM
#3
There is no moveable in VB4
-
May 18th, 2001, 06:25 AM
#4
Damn, you can't subclass either .
So just have a timer, set it's interval at 1, and make the Top and Left property whatever you want them to stay at.
-
May 18th, 2001, 06:27 AM
#5
PowerPoster
Matthew, you can do it by the RemoveMenu API:
Code:
Option Explicit
'//WIN32API Declare
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
'//WIN32API Constant
Private Const MF_BYPOSITION = &H400&
Private Sub Form_Load()
Dim hMenu As Long
'//Get the Menu handle
hMenu = GetSystemMenu(Me.hwnd, 0)
'//Reference
'// Position 0 is Restore Button
'// Position 1 is Move Button
'// Position 2 is Size Button
'// Position 3 is Max Button
'// Position 4 is Min Button
'// Position 5 is Seperator
'// Position 6 is Close Button
'//Remove the X button
RemoveMenu hMenu, 1, MF_BYPOSITION
End Sub
NOTE: But this Position will change upon 1 element is being remove from the menu
-
May 18th, 2001, 06:34 AM
#6
Ok, thanks, I check it out
-
May 18th, 2001, 06:56 PM
#7
The API thingy didn't work. I also tried removing other things, but it just didn't work. Does it only work with sizable form? Because I tried it only for fixed form.
-
May 18th, 2001, 08:06 PM
#8
PowerPoster
It work fine for me (when I change it to Fixed Single/Fixed Dialog).
Perhaps you try to copy the GetSystemMenu and RemoveMenu API declare from your VB4.0 API Viewer.
-
May 19th, 2001, 08:24 AM
#9
Are you using a 16-bit version of windows?
-
May 19th, 2001, 06:26 PM
#10
Nop, Win98.
I try Chris' tip
-
May 19th, 2001, 06:29 PM
#11
Okay, it's working, thanks
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
|