473,888 Members | 1,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1219
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_GETMINMAXINF O and
WM_WINDOWPOSCHA NGED. 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.Pe rmissionSet(Sys tem.Security.Pe rmissions.Secur
ityAction.Deman d, Name="FullTrust ")]

protected override void WndProc(ref Message m)

{

Console.WriteLi ne(m.Msg.ToStri ng());

base.WndProc(re f m);

}
[System.Security .Permissions.Pe rmissionSet(Sys tem.Security.Pe rmissions.Secur
ityAction.Deman d, Name="FullTrust ")]

public override bool PreProcessMessa ge(ref Message msg) {

Console.WriteLi ne(msg.Msg.ToSt ring());

return base.PreProcess Message(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************ ************@IH ateSpam.Net> wrote in message
news:UNPtc.1513 $Tw.1445@lakere ad06...
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
12617
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 file may have been created but a crash occurred at that point in time (while it was being created), damaging the file. Now, my program which needs to read from this file, should first check that it's in good condition, and that it hasn't been...
1
1810
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 have my script flag up a message when one of these events occurs not only would it want to watch the directory, but also the
15
2707
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 this?
1
7665
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 not sock.recv(buffsize) I cannot write to the socket and check if send returns 0 though, because that involves sending data out of the which may not have come in yet. When I try polling the socket with:
3
1863
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 used opera till now, but it seems very buggy piece of software !! I have one very annoyng problem, fighting already ~4 hours. I found that if I use something like this in table (test are
9
2030
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 is null? I've tried something like this (experimenting with IsDBNull): ========================================================= If dtrData.IsDBNull("Address2") = True Then lblAddress2.Text = "" Else
3
3616
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 still able to detect the Shockwave Player and the version number when using Firefox/Netscape, but not with IE. I have my own detection script that I use, but I've also used the detection scripts supplied from Macromedia, but it still won't...
79
3823
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 relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially appeared because NCSA stopped them from using "Mosaic" in the UA string. Is it some different...
5
8817
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 work. I am sure that this probably fairly simple, but I have not been able to figure it out. Z.K.
1
2845
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 in my laptop.But when I connect Pendrive and Mouse in my laptop it is detecting.Any Suggestions are welcome. Thanks in Advance.
0
9800
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10778
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10887
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7148
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5824
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6014
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.