473,811 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

resizing a form

I need to call some procedures after user resized the form.
Not while he is resizing it, but AFTER resizing is finished, i.e. user
released mouse button.
Any ideas how to do this?
Thank you
Nov 17 '05 #1
5 1474
Hi,
Not sure if this is correct, but I bit it's

At the resiziing event set a flag , hook the mouse up event of the form then
check if the flag is set, if so do your procedures and remember to set off
the flag.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alex K." <Al***@discussi ons.microsoft.c om> wrote in message
news:1A******** *************** ***********@mic rosoft.com...
I need to call some procedures after user resized the form.
Not while he is resizing it, but AFTER resizing is finished, i.e. user
released mouse button.
Any ideas how to do this?
Thank you

Nov 17 '05 #2
Thank you Ignacio, but problem is that MouseUp/Down events are not fired when
you click on window's border.
"Ignacio Machin ( .NET/ C# MVP )" wrote:
Hi,
Not sure if this is correct, but I bit it's

At the resiziing event set a flag , hook the mouse up event of the form then
check if the flag is set, if so do your procedures and remember to set off
the flag.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alex K." <Al***@discussi ons.microsoft.c om> wrote in message
news:1A******** *************** ***********@mic rosoft.com...
I need to call some procedures after user resized the form.
Not while he is resizing it, but AFTER resizing is finished, i.e. user
released mouse button.
Any ideas how to do this?
Thank you


Nov 17 '05 #3
The form's ResizeEnd is fired after the mouse button is released.

Andrew
Nov 17 '05 #4
In which platform?
There is no such event in .NET 1.1
"amaca" wrote:
The form's ResizeEnd is fired after the mouse button is released.

Andrew

Nov 17 '05 #5
You'll have to override the WndProc(ref Message m) method of the Form.
Once you do that, you'll have to look for the message that is sent for
a resize and kick off your methods. I'm not entirely sure what the
constant is for the window resize, but you should be able to find it
fairly easy by experimenting with debug statements and a little trial
and error.

Something like this might do:

bool _blnResizing = false;

protected override void OnResize(EventA rgs e)
{
_blnResizing = true;
base.OnResize(e );
}

protected override void WndProc(ref Message m)
{
if(_blnResizing && m.Msg == 533)
{
//TODO: add your code here.
_blnResizing = false;
}
base.WndProc(re f m);
}
I'm not Exactly sure that 533 is the message number in question but I'm
*pretty* sure it's your machine saying you've performed a non-client
mouseup. You may get a better idea by scanning the Win32.h file on your
machine and looking at the names of the constants.

I hope that's helpful.

Ben Lesh
Author, SlickWin Forms Control Suite
Fully Customizable .NET Component Suite
http://www.slickcode.com/slickwin.aspx

Nov 17 '05 #6

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

Similar topics

0
2632
by: TJ Talluto | last post by:
<facts> I have a "month calendar" that always displays exactly 42 days... and alongside is a vertical box that displays the detail (form fields) of any particular select event that appears on the calendar, so that the event may be changed, or a new event may be created. monthname X X X X X X X form X X X X X X X form X X X X X X X form
11
18844
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion that will also either a) stretch the form width wise on widescreens or b), rely on height rather than...
1
5219
by: Terry | last post by:
I've seen several posts from people who have seen this flashing in TreeView's when resizing a form. I've noticed it in my app, but only in the child windows. For example, my main form has a splitter with a TreeView and I do not get the flickering with it. I created a new Form based Windows app. Added a TreeView (dock left), then a splitter and a property grid on the right (dock fill). For this test, I added a panel and button at the...
12
6738
by: Søren Reinke | last post by:
Hi there I have a little problem. How do i make sure that a graph is not redrawn while the form with the graph is being resized ? I have tried to add a mouse up/down event handler on the form1, but it dosn't get called when resizing :( I would like to be able to resize my form, but also make sure the graph is
4
6148
by: Thomas Richter | last post by:
Hi, I can't get of the black flicker when I resize my form. this = Mainform : System.Windows.Forms.Form If I set the size from 300 to 500 I see for ca 500ms some black areas. I try to solve it with: this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.ResizeRedraw, true); But it doesn't work.
6
51930
by: John Bowman | last post by:
Hi All, I must be missing something really obvious, so I'd appreciate someone helping me out. I have a simple Windows form that currently only has a title bar (aka the Text Property is set) and the MinmizeBox, ControlBox and MaximizeBox(es) are all set to false. It's FormBorderStyle is set to "Fixed Single". Eventually this form will have a nice background image. I need to use this form as sort of back drop while other forms/operations...
11
17886
by: Sharon | last post by:
I'm writing a new control derived from UserControl. I need to get an event when the control is done resizing. I tried the Resize, SizeChanged, Move and the Layout events and I also tried to override them. But they all invoked when the control is in the middle of the resizing process. I'm not using breakpoints, I'm using trace to see which one is invoked and when.
13
2513
by: Martin Ho | last post by:
I know this must be trivial for many of you. But I am playing with this and can't figure it out. I have a form, on that form is one panel which has 3 textboxes, when I run my program and maximize the form I want to resize my 3 text boxes according to the size of the form. Each text box should take 33% of the panel's width and full hight of the panel's height. Resizing of the panel is easy with docking... but these 3 textboxes are driving...
6
4551
by: JDeats | last post by:
I have a WinForms based application written for the .NET Framework 2.0 and in this application I need to be able to be able to take some action in code when the user finishes resizing the form. I can easily create an event handler for the SizeChanged form level event, the problem is if the user is using a mouse drag to resize the form this event is firing every few milliseconds or what have you until the user stops the drag process. ...
10
7083
by: mishrarajesh44 | last post by:
hii all, I am facing a problem currently.. i have a script for image uploading and resizing.. the image uploading takes place properly for every size images.. but, the resizing works for only small sized iamages.. for eg. resizing takes place for 70 kb sized images but fails for 600kb or more.. my code is below..
0
9603
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
10379
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...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
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
6882
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
5550
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
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
3015
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.