473,395 Members | 1,456 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,395 software developers and data experts.

Detecting end of re-sizing event?

Have code that is called by my form re-size event. While the form borders
are being dragged back and forth, this code will run continuosly, when it
really only needs to run at the end of the re-size event.

Someone on the Windowsforms group suggested testing in the re-size event to
see if the mouse button is down - when it is released run the code. (at
least that is how I understood it).
I can't figure out how to detect mouse events which occur on the forms
borders, however. (Nor from within a re-size event, which is over when the
mouse is released, anyway)

Can anyone suggest a method for running my code at the end of a re-size? (or
when my mouse is released at the end of a re-size?)

Thanks

--

/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
Nov 20 '05 #1
1 1187
Was given the following on WindowsForms -

Hi,

I meant WM_ and WM_NC messages, which allow to intercept mouse or sizing
related events for non-client areas of windows. Border is not in client area
unfortunately. You have to check Platform SDK for all the details if you
want to know more. In your program you need to override WndProc and to be
able to intercept these messages. In particular you might be able to do what
you want with WM_NCCALCSIZE and WM_NCHITTEST.

If you have thick border you can also intercept WM_GETMINMAXINFO and
WM_WINDOWPOSCHANGED. But you have to check docs to find out what would be
best in your case.

Use these procedures in your form to understand sequence of messages and how
to deal with situation:

[System.Security.Permissions.PermissionSet(System.S ecurity.Permissions.Secur
ityAction.Demand, Name="FullTrust")]

protected override void WndProc(ref Message m)

{

Console.WriteLine(m.Msg.ToString());

base.WndProc(ref m);

}
[System.Security.Permissions.PermissionSet(System.S ecurity.Permissions.Secur
ityAction.Demand, Name="FullTrust")]

public override bool PreProcessMessage(ref Message msg) {

Console.WriteLine(msg.Msg.ToString());

return base.PreProcessMessage(ref msg);

}
I hope you can easily translate it to VB. These will print all messages,
which you get for NC and client areas as they appear.
HTH
Alex
--

/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"What-a-Tool" <Di************************@IHateSpam.Net> wrote in message
news:UNPtc.1513$Tw.1445@lakeread06...
Have code that is called by my form re-size event. While the form borders
are being dragged back and forth, this code will run continuosly, when it
really only needs to run at the end of the re-size event.

Someone on the Windowsforms group suggested testing in the re-size event to see if the mouse button is down - when it is released run the code. (at
least that is how I understood it).
I can't figure out how to detect mouse events which occur on the forms
borders, however. (Nor from within a re-size event, which is over when the
mouse is released, anyway)

Can anyone suggest a method for running my code at the end of a re-size? (or when my mouse is released at the end of a re-size?)

Thanks

--

/ Sean the Mc /
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

Nov 20 '05 #2

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

Similar topics

5
by: Jole | last post by:
Hi I'm writing a program that needs to read from a file. In order for the program to be robust, it should somehow check that the file isn't corrupt, or stuffed in any way. For example, that...
1
by: jeff | last post by:
Hiya I just woundering how would I go about detecting addition, deletion or change to files in a folder? Ideally id like to look at a linux directory and say watch all its contents and then...
15
by: Jay | last post by:
I'm sure this is a really dumb question, but how do you detect a variable type in Python? For example, I want to know if the variable "a" is a list of strings or a single string. How do I do...
1
by: Tim Gosselin | last post by:
I am writing a tcp tunnel but cannot find a way of detecting when a socket shuts down its read end without writing to the socket. For testing the write end of the remote endpoint I just do a: if...
3
by: raptor | last post by:
hi, how to detect opera..it seems that even opera8 doesnt support xmlhttp fully (.i.e. sendRequestHeader). I ask this 'cause opera seems to mimic IE, at least in the preferences ?! I havent...
9
by: D. Shane Fowlkes | last post by:
I'm using SQL Server 2000 and on my page, I'm simply creating a SQLDataReader and filling in Labels with the retrieved (single) record. However, how can I prevent from getting errors when a field...
3
by: regtrashcan | last post by:
I have a webpage that detects whether Shockwave Player is installed and the version number. The javascript/vbscript that I use has worked fine until the latest release of the Shockwave Player. I am...
79
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the...
5
by: Z.K. | last post by:
In C#, using the StreamReader, how do I detect when you get to the end of line. I am reading a text file using the Read() function and I need to detect the \n\r, but everything I try does not...
1
by: davidson1 | last post by:
Hello Friends, I am using HP Laptop.I have a MP3 Player.I used to charge it using my laptop(Windows XP).But Nowadays it is not detecting and charging whenever I connect MP3 Player...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.