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

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 1358
hi,

the Form_Resize event did nothing for you?
"What-a-Tool" <Di************************@NoShitSherlock.Net> wrote in
message news:HiHIb.31070$F22.11025@lakeread02...
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************************@NoShitSherlock.Net> 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********************@TK2MSFTNGP11.phx.gbl.. .
* "What-a-Tool" <Di************************@NoShitSherlock.Net> 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************************@NoShitSherlock.Net> 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.Interval=300
ResizeTimer.Start()
end sub

sub ResizeTimer_Tick(...)
ResizeTimer.Stop()
'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************************@NoShitSherlock.Net> escribió en el mensaje news:HiHIb.31070$F22.11025@lakeread02...
| 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************************@NoShitSherlock.Net> wrote in
message news:HiHIb.31070$F22.11025@lakeread02...
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(System.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.OnSizeChanged(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************************@NoShitSherlock.Net> wrote in
message news:HiHIb.31070$F22.11025@lakeread02...
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
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...
2
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
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...
11
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...
1
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...
6
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...
6
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...
4
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...
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: 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: 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
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...
0
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,...
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...

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.