c# - Windows resizing jumps instead going smoothly -


I have a problem while trying to apply a custom button for window resizing. This video shows what's going on < / P>

I use the thumb element to implement a custom resize button for the window.

  & lt; Thumb style = "{StaticResource ThumbStyle}" dragstart = "thumb_on drag starred" DragDelta = "Thumb_OnDragDeltanDragDelta" />  

and the code behind it

  Private Zero Thumb_OnDragDeltanDragDelta (Object Sender, DragDeltaEventArgs e) {LogWindow.Height = m_BaseSize.Y + e.VerticalChange; Logwindows With = am_seasseas.x + e Hogstall change; } Private Zero Thumb_OnDragStarted (Object Sender, DragStartedEventArgs e) {m_BaseSize.X = LogWindow. Width; M_BaseSize.Y = LogWindow.height; }  

How to do custom resizing more equally for the basic implementation?

Edit: It seems that I understand what the problem is Thumb_OnDragDeltanDragDelta some time invalid vertical change is received

< Div class = "post-text" itemprop = "text">

I no longer trust data from this event, and I use the mouse coordinate. All look good now

  Private Zero Thumb_OnDragDeltanDragDelta (Object Sender, DragDeltaEventArgs E) {var Source = Presentation Source.frameVidual (this); Point Status = Mouse Gapeption (this); Var hwndSource = Presentation Source.frameVisional (Visible Sender) as HWDSOSR; Matrix Transformation Transview = Source. Composition tag Transforosdios; Point [] p = {new point (left, top), new point (position x, position .i)}; TransformToDevice.Transform (P); SetWindowPos (hwndSource.Handle, IntPtr.Zero, Convert.ToInt32 (p [0] .X), Convert.OINT 32 (P [0]. Y), Convert.OINIT 32 (P [1] .X), Convert. OINIT 32 (P [1]. Y), Set Window Pisflags. SWP Savivando); }  

and use winApi resize

  [DllImport ("user32.dll", Charset = Charset. Auto)] [Return: Marshall AS ( UnmanagedType.Bool)] Private Static Extra Bull Setwondoopos (Intupetated HWND, Interpol HWNINSER, Int X, Int Y, Int CX, Int Sie, Sattwondo Pisflag's Uflags); [Flags] public enum SetWindowPosFlags: uint {SWP_ASYNCWINDOWPOS = 0x4000, SWP_DEFERERASE = 0x2000, SWP_DRAWFRAME = 0x0020, SWP_FRAMECHANGED = 0x0020, SWP_HIDEWINDOW = 0x0080, SWP_NOACTIVATE = 0x0010, SWP_NOCOPYBITS = 0x0100, SWP_NOMOVE = 0x0002, SWP_NOOWNERZORDER = 0x0200, SWP_NOREDRAW = 0x0008, SWP_NOREPOSITION = 0x0200, SWP_NOSENDCHANGING = 0x0400, SWP_NOSIZE = 0x0001, SWP_NOZORDER = 0x0004, SWP_SHOWWINDOW = 0x0040,}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -