resize window in 10 pixel steps

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotrekk

    #1

    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

  • =?utf-8?Q?Bahad=C4=B1r_ARSLAN?=

    #2
    Re: resize window in 10 pixel steps

    Hi,

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

    "Piotrekk" <Piotr.Kolodzie j@gmail.com>, iletisinde şunu yazdı,
    news:1187771630 .556788.145690@ r23g2000prd.goo glegroups.com.. .
    Hi
    >
    I was wandering if is this possible to resize window in steps
    different than 1 px.
    Thanks
    >
    PK
    >

    Comment

    • Piotrekk

      #3
      Re: resize window in 10 pixel steps

      On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars... @netron.com.trw rote:
      Hi,
      >
      You can set windows width and height pixels so you can increment 10 px.
      >
      "Piotrekk" <Piotr.Kolodz.. .@gmail.com>, iletisinde unu yazd ,news:118777163 0.556788.145690 @r23g2000prd.go oglegroups.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?

      Comment

      • Piotrekk

        #4
        Re: resize window in 10 pixel steps

        On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars... @netron.com.trw rote:
        Hi,
        >
        You can set windows width and height pixels so you can increment 10 px.
        >
        "Piotrekk" <Piotr.Kolodz.. .@gmail.com>, iletisinde unu yazd ,news:118777163 0.556788.145690 @r23g2000prd.go oglegroups.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?

        Comment

        • =?utf-8?Q?Bahad=C4=B1r_ARSLAN?=

          #5
          Re: resize window in 10 pixel steps

          Sorry, i couldn't understand what you want to do?

          Can you tell with more details?

          "Piotrekk" <Piotr.Kolodzie j@gmail.com>, iletisinde şunu yazdı,
          news:1187774300 .917705.134820@ z24g2000prh.goo glegroups.com.. .
          On 22 Sie, 11:10, Bahad r ARSLAN <bahadir.ars... @netron.com.trw rote:
          >Hi,
          >>
          >You can set windows width and height pixels so you can increment 10 px.
          >>
          >"Piotrekk" <Piotr.Kolodz.. .@gmail.com>, iletisinde unu yazd
          >,news:11877716 30.556788.14569 0@r23g2000prd.g ooglegroups.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?
          >

          Comment

          • Peter Duniho

            #6
            Re: resize window in 10 pixel steps

            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(ob ject sender, EventArgs e)
            {
            Control ctl = (Control)sender ;

            ctl.Size = new Size(((ctl.Widt h + 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

            Comment

            • Ben Voigt [C++ MVP]

              #7
              Re: resize window in 10 pixel steps


              "Piotrekk" <Piotr.Kolodzie j@gmail.comwrot e in message
              news:1187771630 .556788.145690@ r23g2000prd.goo glegroups.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
              >

              Comment

              Working...