Hi,
You can set windows width and height pixels so you can increment 10 px.
> Hi
>
[quoted text clipped - 3 lines]
>
> PK
Piotrekk - 22 Aug 2007 10:18 GMT
On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars...@netron.com.tr> wrote:
> Hi,
>
[quoted text clipped - 7 lines]
>
> > PK
Yeah but how to get new size in Resize Begin or Resize event?
Piotrekk - 22 Aug 2007 10:18 GMT
On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars...@netron.com.tr> wrote:
> Hi,
>
[quoted text clipped - 7 lines]
>
> > PK
Yeah but how to get new size in Resize Begin or Resize event?
Bahadır ARSLAN - 22 Aug 2007 10:21 GMT
Sorry, i couldn't understand what you want to do?
Can you tell with more details?
> On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars...@netron.com.tr> wrote:
>> Hi,
[quoted text clipped - 10 lines]
>
> Yeah but how to get new size in Resize Begin or Resize event?
> 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
> 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