Solved

How can make the window(vbform) unmovable using API?

Posted on 2002-03-08
5
229 Views
Last Modified: 2012-06-27
How can make the window(vbform) unmovable using API?
0
Comment
Question by:kkps_s
5 Comments
 
LVL 1

Expert Comment

by:Madmarlin
ID: 6850309

.Moveable property

Form1.Moveable = false.
0
 
LVL 1

Expert Comment

by:Madmarlin
ID: 6850310
Ah sorry didnt read it all..
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6850483
I have tested it and figured out, that you can't reset the
windows WS_EX_NODRAG flag during runtime. I think you can only set this attribute during a CreateWindowEx Api call which creates the window ... Resetting the attribute with this code bring no results because my explanations above:

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const GWL_EXSTYLE = (-20)
Private Const WS_EX_NODRAG = &H40000000

Private Sub Form_Activate()
 Call SetWindowLong(Me.hwnd, GWL_EXSTYLE, WS_EX_NODRAG)
End Sub


;)
WoK
0
 
LVL 5

Expert Comment

by:kcm76
ID: 6851333
try other ways. like
u can always disable/hide the move menuitem in the system menu of the dialog box. also the hide the mousecursor in the dialog bar.

KCM
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 75 total points
ID: 6852225
Hi!

Here's a file for you over the net:

Download...
http://www.vb-helper.com/HowTo/nomove.zip
Description: Prevent a form from moving (3K)

That's it!

glass cookie : )
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Basic Excel Formatting error 4 125
JSON Response and request in VB6 application 11 568
MS Access Search and Replace Using VBA 6 80
Access 2013 combo box not working 3 51
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question