473,511 Members | 14,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

resize window in 10 pixel steps

Hi

I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks

PK

Aug 22 '07 #1
6 2162
Hi,

You can set windows width and height pixels so you can increment 10 px.

"Piotrekk" <Pi*************@gmail.com>, iletisinde şunu yazdı,
news:11**********************@r23g2000prd.googlegr oups.com...
Hi

I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks

PK
Aug 22 '07 #2
On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars...@netron.com.trwrote:
Hi,

You can set windows width and height pixels so you can increment 10 px.

"Piotrekk" <Piotr.Kolodz...@gmail.com>, iletisinde unu yazd ,news:11**********************@r23g2000prd.googleg roups.com...
Hi
I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks
PK
Yeah but how to get new size in Resize Begin or Resize event?

Aug 22 '07 #3
On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars...@netron.com.trwrote:
Hi,

You can set windows width and height pixels so you can increment 10 px.

"Piotrekk" <Piotr.Kolodz...@gmail.com>, iletisinde unu yazd ,news:11**********************@r23g2000prd.googleg roups.com...
Hi
I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks
PK
Yeah but how to get new size in Resize Begin or Resize event?

Aug 22 '07 #4
Sorry, i couldn't understand what you want to do?

Can you tell with more details?

"Piotrekk" <Pi*************@gmail.com>, iletisinde şunu yazdı,
news:11**********************@z24g2000prh.googlegr oups.com...
On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars...@netron.com.trwrote:
>Hi,

You can set windows width and height pixels so you can increment 10 px.

"Piotrekk" <Piotr.Kolodz...@gmail.com>, iletisinde unu yazd
,news:11**********************@r23g2000prd.google groups.com...
Hi
I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks
PK

Yeah but how to get new size in Resize Begin or Resize event?
Aug 22 '07 #5
Piotrekk wrote:
Hi

I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks
If you want to limit the user to only being able to size the window in
10 pixel increments, I believe you need to implement this yourself. You
would handle the Resize event, and in there, look at the current Size of
the control that is the sender of the event, then calculate a new Size
as desired, and finally reassign that new Size to the sender.

You'll have to cast the sender to a Control type, of course, so that you
can access the Control class members of the Form.

Something like this might work for you:

private void Form1_Resize(object sender, EventArgs e)
{
Control ctl = (Control)sender;

ctl.Size = new Size(((ctl.Width + 5) / 10) * 10,
((ctl.Height + 5) / 10) * 10);
}

This makes the form restricted to the nearest 10-pixel increment of size
based on the dragging. The "+ 5" before doing the division handles the
rounding; if you just want to truncate to the 10-pixel increment less
than or equal to the dragged size, don't include that part.

Pete
Aug 22 '07 #6

"Piotrekk" <Pi*************@gmail.comwrote in message
news:11**********************@r23g2000prd.googlegr oups.com...
Hi

I was wandering if is this possible to resize window in steps
different than 1 px.
Thanks
Handle WM_SIZING:

http://msdn2.microsoft.com/en-us/library/ms632647.aspx
>
PK
Aug 23 '07 #7

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

Similar topics

4
1786
by: ire2874 | last post by:
I'm trying (unsuccessfuly) to resize a browser window in Netscape (v8) using javascript - There are 2 methods I am trying to use below but neither works. Any tips? I only need this for...
3
3247
by: Z D | last post by:
Hello, BACKGROUND: ============== I've created a Windows User Control that contains an Image Control (among other controls). The user control handles the picture resize event. Whenever the...
15
5302
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
69
13335
by: RC | last post by:
I know how to do this in JavaScript by window.open("newFile.html", "newTarget", "scrollbars=no,resizable=0,width=200,height=200"); The browser will open a new window size 200x200, not allow...
2
17495
by: daveyand | last post by:
Hey Guys I am able to detect a window resize using the following code: window.onresize = function () { if(document.getElementById("parent_for_video").style.display != "none") {...
1
5571
by: Bob Alston | last post by:
I have a system where many subforms are used. Often the size of the subform had to be larger than could be displayed without scrolling. I set the height of the subform to the typical height...
14
3197
by: ShutterMan | last post by:
Im needing to resize a DIV tag to the entire height of the page. To me, this doesnt seem like it should be very difficult, but alas, its beating me. The content within the div may be tables,...
2
2028
by: Noorain | last post by:
Hi, another problem. i upload width=800 pixels image in database through. this image resize by thumb image & bis image. thumb image width is 100 pixel & big image width is 400 pixel. 800 pixel image...
6
5771
by: Tarren | last post by:
Hi: I am trying to get access to the event after a window has been resized. The events I have been using SizeChanged and Resize all fire after any pixel size change. What I am trying to...
0
7237
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
7137
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
7349
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,...
0
7417
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...
1
7074
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...
0
5659
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,...
1
5063
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...
0
1572
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 ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.