473,654 Members | 3,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Releasing mouses grip on forms sizeable edge?

I have an mdichild form whose minimum size I want to limit (can't be dragged
below a certain size)
Even though I am running .NET 1.1 where the minimum size property supposedly
works, it's not working for my child forms.

Herfried K. Wagner directed me to a code sample which he wrote as a work
around for this problem.
Very interesting code. You're obviously light years ahead of me in
programing skills. Some day in the near future I plan on taking the time to
sit and check it out a bit more closely to try and undertand exactly what is
going on there. Right now though, I can't figure how to use it to get what I
want to happen. Thanks for the help though.

But for now-
Is it posible to get the mouse to release its grip on the edge of the form
as it's being dragged to a new size?
Have my form resize itself to my desired minimum size whenever it reaches my
min size, but the mouse retains its grip, enabling me to drag the form edge
around as small as I want. It always apears as my min size, but this just
causes it to flicker like crazy until you finally release the mouse button.
Can I force this release when my desired size is reached?
--

/ 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
7 1373
hi,

the Form_Resize event did nothing for you?
"What-a-Tool" <Di************ ************@No ShitSherlock.Ne t> wrote in
message news:HiHIb.3107 0$F22.11025@lak eread02...
I have an mdichild form whose minimum size I want to limit (can't be dragged below a certain size)
Even though I am running .NET 1.1 where the minimum size property supposedly works, it's not working for my child forms.

Herfried K. Wagner directed me to a code sample which he wrote as a work
around for this problem.
Very interesting code. You're obviously light years ahead of me in
programing skills. Some day in the near future I plan on taking the time to sit and check it out a bit more closely to try and undertand exactly what is going on there. Right now though, I can't figure how to use it to get what I want to happen. Thanks for the help though.

But for now-
Is it posible to get the mouse to release its grip on the edge of the form
as it's being dragged to a new size?
Have my form resize itself to my desired minimum size whenever it reaches my min size, but the mouse retains its grip, enabling me to drag the form edge around as small as I want. It always apears as my min size, but this just
causes it to flicker like crazy until you finally release the mouse button. Can I force this release when my desired size is reached?
--

/ 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
* "What-a-Tool" <Di************ ************@No ShitSherlock.Ne t> scripsit:
I have an mdichild form whose minimum size I want to limit (can't be dragged
below a certain size)


The only way I see (I still don't understand why the properties and the
"workaround " don't work on your machine) is to handle the form's
'Resize' event and reset the size whenever it is changed to a size
smaller/larger than the allowed minimum/maximum size.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Herfried -
Your work around does work on my system. I'm still trying to figure out how
it works, though, so I can apply it to my project. I just haven't had the
time to sit with it and figure it out yet though.
Like I said, it's very interesting code, and I think I might like to use it.

However, I had already started to solve this problem my own way before I was
given this other (admittedly better) solution, and now I am still wondering
if I could get it to work my way.

In my forms re-size event I call a procedure that checks to see if my form
is < its minimum size. If yes, I re-size it to my desired size.
So far so good.
However, if I fail to release the mouse button, it retains it's grip on the
location were my form edge should have been, and I can still drag this back
and forth, causing my form to flicker like crazy.
Can I get my mouse to release this grip rite after my resizing action?
Thank You

--

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

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:Oc******** ************@TK 2MSFTNGP11.phx. gbl...
* "What-a-Tool" <Di************ ************@No ShitSherlock.Ne t> scripsit:
I have an mdichild form whose minimum size I want to limit (can't be dragged below a certain size)


The only way I see (I still don't understand why the properties and the
"workaround " don't work on your machine) is to handle the form's
'Resize' event and reset the size whenever it is changed to a size
smaller/larger than the allowed minimum/maximum size.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #4
* "What-a-Tool" <Di************ ************@No ShitSherlock.Ne t> scripsit:
Your work around does work on my system. I'm still trying to figure out how
it works, though, so I can apply it to my project. I just haven't had the
time to sit with it and figure it out yet though.
Like I said, it's very interesting code, and I think I might like to use it.
Would be interesting if the 'MinimumSize' property works on an other
machine...
In my forms re-size event I call a procedure that checks to see if my form
is < its minimum size. If yes, I re-size it to my desired size.
So far so good.
However, if I fail to release the mouse button, it retains it's grip on the
location were my form edge should have been, and I can still drag this back
and forth, causing my form to flicker like crazy.


That's the "drawback" of this method. Using 'MinimumSize' will prevent
the form from doing that. It's the only way to prevent the form from
doing that and it /should/ work (at least with .NET 1.1).

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

I haven't done it yet on .NET, but in VB6 I used a timer to handle the resize event when it caused flicker.
Could be something like this:

'\\\
sub form_resize(... )
ResizeTimer.Int erval=300
ResizeTimer.Sta rt()
end sub

sub ResizeTimer_Tic k(...)
ResizeTimer.Sto p()
'Beep 'For testing...
'Put here the code you actually have on the Resize event.
end sub
'///

This code makes the resize event not to be launched (from the point of view of the user) until 0.3 seconds after the user stops (or pauses) the resizing of the form.
With this code in VB6, the timer's counter restarts each time the resize event is launched. I suppose it does the same under .NET.

Regards.
"What-a-Tool" <Di************ ************@No ShitSherlock.Ne t> escribió en el mensaje news:HiHIb.3107 0$F22.11025@lak eread02...
| I have an mdichild form whose minimum size I want to limit (can't be dragged
| below a certain size)
| Even though I am running .NET 1.1 where the minimum size property supposedly
| works, it's not working for my child forms.
|
| Herfried K. Wagner directed me to a code sample which he wrote as a work
| around for this problem.
| Very interesting code. You're obviously light years ahead of me in
| programing skills. Some day in the near future I plan on taking the time to
| sit and check it out a bit more closely to try and undertand exactly what is
| going on there. Right now though, I can't figure how to use it to get what I
| want to happen. Thanks for the help though.
|
| But for now-
| Is it posible to get the mouse to release its grip on the edge of the form
| as it's being dragged to a new size?
| Have my form resize itself to my desired minimum size whenever it reaches my
| min size, but the mouse retains its grip, enabling me to drag the form edge
| around as small as I want. It always apears as my min size, but this just
| causes it to flicker like crazy until you finally release the mouse button.
| Can I force this release when my desired size is reached?
|
|
| --
|
| / 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 #6
I think I discovered my problem.

Was informed by someone on the .NET framework group that VS 2002 uses
framework 1.0, even though I have 1.1 installed on my computer.

To take advantage of the minimum form size as well as other features of 1.1,
I need to upgrade to VS 2003.

Spose' I should have pointed out the fact that I am using 2002 somewhere in
THIS discusion.

Thanks for the help

--

/ 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************ ************@No ShitSherlock.Ne t> wrote in
message news:HiHIb.3107 0$F22.11025@lak eread02...
I have an mdichild form whose minimum size I want to limit (can't be dragged below a certain size)
Even though I am running .NET 1.1 where the minimum size property supposedly works, it's not working for my child forms.

Herfried K. Wagner directed me to a code sample which he wrote as a work
around for this problem.
Very interesting code. You're obviously light years ahead of me in
programing skills. Some day in the near future I plan on taking the time to sit and check it out a bit more closely to try and undertand exactly what is going on there. Right now though, I can't figure how to use it to get what I want to happen. Thanks for the help though.

But for now-
Is it posible to get the mouse to release its grip on the edge of the form
as it's being dragged to a new size?
Have my form resize itself to my desired minimum size whenever it reaches my min size, but the mouse retains its grip, enabling me to drag the form edge around as small as I want. It always apears as my min size, but this just
causes it to flicker like crazy until you finally release the mouse button. Can I force this release when my desired size is reached?
--

/ 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 #7
This was a reply I recieved in the WindowsForms group:
You want it to stop all sizing (including when the mouse is dragged back to
the right to make it larger)? If so, you could send the window a
WM_CANCELMODE message; normally you do this with the SendMessage api but you
could just override the OnSizeChanged method of the form and call the
WndProc with this message.

private const int WM_CANCELMODE = 0x1F;

protected override void OnSizeChanged(S ystem.EventArgs e)
{
if (this.Width < 200 ||
this.Height < 200)
{
Message msg = new Message();
msg.HWnd = this.Handle;
msg.Msg = WM_CANCELMODE;
this.WndProc( ref msg );
}

base.OnSizeChan ged(e);
}


--

/ 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************ ************@No ShitSherlock.Ne t> wrote in
message news:HiHIb.3107 0$F22.11025@lak eread02...
I have an mdichild form whose minimum size I want to limit (can't be dragged below a certain size)
Even though I am running .NET 1.1 where the minimum size property supposedly works, it's not working for my child forms.

Herfried K. Wagner directed me to a code sample which he wrote as a work
around for this problem.
Very interesting code. You're obviously light years ahead of me in
programing skills. Some day in the near future I plan on taking the time to sit and check it out a bit more closely to try and undertand exactly what is going on there. Right now though, I can't figure how to use it to get what I want to happen. Thanks for the help though.

But for now-
Is it posible to get the mouse to release its grip on the edge of the form
as it's being dragged to a new size?
Have my form resize itself to my desired minimum size whenever it reaches my min size, but the mouse retains its grip, enabling me to drag the form edge around as small as I want. It always apears as my min size, but this just
causes it to flicker like crazy until you finally release the mouse button. Can I force this release when my desired size is reached?
--

/ 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 #8

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

Similar topics

5
1553
by: Martin Trautmann | last post by:
Hi all, is there any standard for grip markers? I've found the fo:marker, but I look for some kind of support for "grip marker" or "side makers" - what's the correct English / XSL term to look for? I want to place white letters on black box markers on the right side of the page (as it is used e.g. in phone books for faster navigation) Thanks,
2
3838
by: Lumpierbritches | last post by:
I want to know if you can set position of a form, next to an open form in Access 97 through 2003? Thank you for any and all responses, they are greatly appreciated. Michael
4
6839
by: lauren quantrell | last post by:
I have an Access 2K popup form to which I have added buttons to run DoCmd.Maximize The problem is the form opens full height on the screen, with the bottom of the form hidden under the Windows taskbar. Is there a way to maximize the form so that a portion of it is not hidden under the taskbar? thanks, lq
11
1891
by: Patrick Fisher | last post by:
Later versions of Access have form property called Moveable which, if set, prevents users from moving forms yet still allows the form to retain a border. Access 97 does not have this property therefore the only way to prevent users from moving forms is to have forms with no borders, is there a way in Access 97 to mimic the Moveable Property? Patrick
1
2354
by: Andrei Zinca | last post by:
When I resize my window, the sizing grip from the status bar doesn't dissapear. The funny thing is that if i create a graphics object and dispose it before the creation of the status bar everything works fine. Maybe someone can help me with this problem. Thanks! Here's my StatusBar initialization routine void InitStatusBar() {
6
3158
by: Brian Basquille | last post by:
Hello all. Due to the short time remaining to my project handup for my Air Hockey game, i've abandoned the idea of implementing it over a network. But since the only real way to play Air Hockey is using a mouse, i was wondering if it is possible for 2 people to use 2 mouses while on the same computer? For example, 1 mouse could be in USB port and other in PS/2 port. Does C Sharp support this? And if so, can anyone point me to some...
6
1721
by: Jesse Aufiero | last post by:
I was wondering if anyone knows how to get a datagrid to size as the browser is resized such that the datagrid's borders would appear anchored to the browser edges. The datagrid should have a white-space border around it and scrollbars should automatically appear on the datagrid should the contents of the grid spill outside of the viewable area. I have gotten this to work for the IE browser by placing a DIV tag around the datatable...
4
1789
by: Jacob.Bruxer | last post by:
I've been unable to find a simple answer to what I initially thought was going to be a simple question. I want to be able to restrict the size of my forms in a VB.net project. I don't want users to be able to make the forms either smaller or bigger than the size I've set them at. How is this done? Thanks.
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
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
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8494
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
6162
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
5627
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
4150
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
4297
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1597
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.