473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

make a window unmovable

how do i make a window unmovable so its locked in place
Nov 20 '05 #1
3 4464
Hi,

You will either have to reset the position of your form in the OnMove event
Or simply take make the form BorderStyle NONE and the control box false.

Hope this helps.
rawCoder

"savage" <sa****@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
how do i make a window unmovable so its locked in place

Nov 20 '05 #2
Remove the Border by setting the border style to none

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing

"savage" <sa****@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
how do i make a window unmovable so its locked in place

Nov 20 '05 #3
* =?Utf-8?B?c2F2YWdl?= <sa****@discussions.microsoft.com> scripsit:
how do i make a window unmovable so its locked in place
From my FAQ:

Based on an implementation written by Tom Spink.

The code below defines a base class that provides a 'Moveable' property.
By inheriting from this class and setting the 'Moveable' property to
'False', the user will be prevented from moving then form:

\\\
Imports System.ComponentModel
Imports System.Windows.Forms

Public Class MoveableForm
Inherits Form

Private Const WM_NCLBUTTONDOWN As Int32 = &HA1
Private Const WM_SYSCOMMAND As Int32 = &H112

Private Const HTCAPTION As Int32 = &H2

Private Const SC_MOVE As Int32 = &HF010

Private m_Moveable As Boolean

Public Sub New()
MyBase.New()
Me.Moveable = True
End Sub

< _
Category("Behavior"), _
Description("Allows the form to be moved.") _ _

Public Property Moveable() As Boolean
Get
Return m_Moveable
End Get
Set(ByVal Value As Boolean)
m_Moveable = Value
End Set
End Property

Protected Overrides Sub WndProc(ByRef m As Message)
If Not m_Moveable Then
If _
m.Msg = WM_SYSCOMMAND And _
m.WParam.ToInt32() = SC_MOVE _
OrElse _
m.Msg = WM_NCLBUTTONDOWN And _
m.WParam.ToInt32() = HTCAPTION _
Then
Return
End If
End If
MyBase.WndProc(m)
End Sub
End Class
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Eric Osman | last post by:
Hi, When I run the following html file on netscape, and the button is clicked, the new window pops BEHIND all my other windows. How can I easily fix this html file so the window comes up in...
1
by: amith | last post by:
Hi, I have a javascript, calendar.js which i use to enable my client to select the date. This calendar pops up on the click of a gif image. But the problem is that this poped up window is not...
40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
10
by: CyberBless | last post by:
I have a page that opens a child window using window.open(...). How do I make so that when that child window opens you cannot get the focus back on the parent window unless you close the child...
8
by: Shamrokk | last post by:
My application has a loop that needs to run every 2 seconds or so. To acomplish this I used... "Thread.Sleep(2000);" When I run the program it runs fine. Once I press the button that starts the...
4
by: sam.s.kong | last post by:
Hello! I opened a new window using 'resizable=no'. Can the child window make itself resizable even if it's opened with 'resizable=no'? For example: <body onload="javascript:...
6
by: divya | last post by:
I have a page name edit.asp which should expire immediately .The user cannot open this page directly he has to provide a password for entering this page.thus when the user enters edit.asp , it has...
6
by: SAL | last post by:
Hi, VS2005 post I'm opening a window using the following syntax: Protected Sub lbEstValue_Click(ByVal sender As Object, ByVal e As System.EventArgs)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.