Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3852252
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:17:23+00:00 2026-05-19T17:17:23+00:00

Background: I have a window that starts out with a width of 240px, some

  • 0

Background:
I have a window that starts out with a width of 240px, some visual elements can only be displayed a particular way at this width, however resizing is allowed and must be allowed.

If someone decides to resize, then i will need some sort of “Snap” to get back to the original width. It would be a pain/next to impossible to require the users to get the exact px right in order to restore full visual effects.

Question: So, how can i make it so if they get to a certain distance (lets say, within 4px) away from 240px in either direction, it will snap to that width, and resize to a different size only when the resize cursor has strayed over 4px away from the width..

Failed Ideas: ive played with several different things that set the width of the window to 240 on the sizeChanged event if its within the 4px, but since that is on the size event, it will do the calculations after the window has already resized. which means that you get a really choppy effect when it is being resized to/away from the default width.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:17:24+00:00Added an answer on May 19, 2026 at 5:17 pm

    Here is a message that explains how to gain fine-grained control over the resizing by handling the WM_SIZING message in your own window procedure:

    • How to resize or drag a WPF window along with particular X or Y axis?

    The moderator’s sample code is in VB but there are plenty of C#/WinForms examples you can use to get started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML 5 code that starts out with two black canvases and
Some background: we have a windows application (c#) that locate in the system try.
I have a Windows process that runs in the background and periodically backs up
Background info: I have a windows application (in c#) that handles a custom file
I have a java program that is running in the background(Windows). I would like
Background Information: I have a single Window VPS at example.com. I have it running
Background: I'm using SQL Server Management Studio 2008 and I have a query window
I have a css rule defining the background color as the window system color
I've run into an issue that I can't seem to figure out the solution
I have a windows service that fails to start under some circumstances. When it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.