window-resize

TextBox with bottom border

不羁岁月 提交于 2019-12-01 08:17:36
问题 I want to have TextBox with bottom border but Graphics drawn for TextBox is distorted/broken on resize because of Color.Transparent . Using an code I found, I was able to create a underlined TextBox (Drawn Rectangle with tranparent top, left, right). The problem is when I resize the form/window: when I resize it to smaller, then resize again to expand it, the graphics drawn is distorted. Any fix for this? Here are photos: The second photo has been already resized smaller, then back to a

WPF Borderless window resize

烂漫一生 提交于 2019-12-01 03:31:05
I am designing my own custom window in WPF and I have been trying to implement the resizing functionality I have used previously in WinForms. For some reason the return value of my WndProc isn't giving me the proper result. I have a NativeMethods class for all my WndProc messages and results: public class NativeMethods { public const int WM_NCHITTEST = 0x84; public const int HTCAPTION = 2; public const int HTLEFT = 10; public const int HTRIGHT = 11; public const int HTTOP = 12; public const int HTTOPLEFT = 13; public const int HTTOPRIGHT = 14; public const int HTBOTTOM = 15; public const int

jQuery dynamically change element height

心不动则不痛 提交于 2019-11-30 18:48:55
I'm working on a fluid layout project. I have some fixed height DIVs in my document, and the heights are different for all of them. I need to proportionally change these DIVs height on browser resize. Here is the markup. <body> <div id="a" class="target"></div> <div id="b" class="target"></div> <div id="c" class="target"></div> </body> And css: <style> body { width: 90%; margin: 0 auto;} .target { width:30%; float:left; margin:1.6%; cursor:pointer; } #a { height: 200px; background-color: yellow;} #b { height: 400px; background-color: green;} #c { height: 600px; background-color: grey;} </style

When (and how) to lay out the children of a Win32 window in response to a resize?

偶尔善良 提交于 2019-11-30 16:03:45
Windows sends several messages when a window is resized: WM_GETMINMAXINFO WM_ENTERSIZEMOVE WM_EXITSIZEMOVE WM_NCCALCSIZE WM_SIZING WM_SIZE WM_WINDOWPOSCHANGING WM_WINDOWPOSCHANGED and possibly more. If I would like to re-position the children when my window is resized, where and how should I do so? I'm looking for the "best" method -- i.e. the method with the fewest gotcha's and the least flicker . My current method is to perform all the repositioning inside WM_NCCALCSIZE , using DeferWindowPos . However, I've also tried handling it inside WM_WINDOWPOSCHANGED ... but no matter where I handle

When (and how) to lay out the children of a Win32 window in response to a resize?

筅森魡賤 提交于 2019-11-30 16:03:19
问题 Windows sends several messages when a window is resized: WM_GETMINMAXINFO WM_ENTERSIZEMOVE WM_EXITSIZEMOVE WM_NCCALCSIZE WM_SIZING WM_SIZE WM_WINDOWPOSCHANGING WM_WINDOWPOSCHANGED and possibly more. If I would like to re-position the children when my window is resized, where and how should I do so? I'm looking for the "best" method -- i.e. the method with the fewest gotcha's and the least flicker . My current method is to perform all the repositioning inside WM_NCCALCSIZE , using

Why does the size of the JFrame exceed the size of its ContentPane, even though it has a defined size?

放肆的年华 提交于 2019-11-29 16:14:52
I noticed a strange behavior between containers in the swing. To exemplify the test, I created a JFrame and a JPanel, and set the panel as contentPane. I defined the preferred and maximum JPanel size to 400,300. All this can be seen in the example below: import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JPanel; public class ExcessiveSpacePanelTest { JFrame frame; JPanel panel; public void initGUI(){ frame = new JFrame(); panel = new JPanel(); panel.setBorder(BorderFactory

Java window contents resize, but not beyond a minimum size

余生长醉 提交于 2019-11-29 16:03:58
I have a Java apps I've written using NetBeans (yes, I've read plenty of complaints here about NetBeans). When I resize the window, the contents resize with the window, until I shrink the window (the height, actually) below a certain size. Then the window resizes, but the contents just get clipped. I've checked all of the component widgets. They all have min sizes of zero or very small numbers. The only ones with nonzero preferred sizes are those that do not resize with their parents, and they are also small. When shrinking, I'm not bumping into any of the widgets. At the point where I cannot

WPF: Make window unresizeable, but keep the frame?

江枫思渺然 提交于 2019-11-29 14:08:11
问题 I have a window that does not have a title bar ( WindowStyle == WindowStyle.None ). The entire window uses the Aero glass effect. When I make the window unresizeable ( ResizeMode == ResizeMode.NoResize ), the glass effect disappears and my controls just hang in midair. (Essentially, the window itself disappears but leaves its contents.) Is there a way for me to make the window unresizeable without getting rid of the window frame? I have read the question Enable Vista glass effect on a

How to set NSView size programmatically?

感情迁移 提交于 2019-11-29 13:41:07
问题 How do you set the size of NSView programmically e.g. -(void)awakeFromNib { self.frame.size.width = 1280; // Does nothing... self.frame.size.height = 800; // ...neither does this. ... The size setup in the nib (of Mac OSX) works OK, but I want to do it in code. 回答1: When you call self.frame, it returns the data in the frame, and not a pointer. Therefore, any change in the result is not reflected in the view. In order to change the view, you have to set the new frame after you make changes: -

Call a function when window is resized

天涯浪子 提交于 2019-11-29 11:06:17
问题 How can I call for this(or any) JS function to be run again whenever the Browser window is resized? <script type="text/javascript"> function setEqualHeight(e) { var t = 0; e.each(function () { currentHeight = $(this).height(); if (currentHeight > t) { t = currentHeight } }); e.height(t) } $(document).ready(function () { setEqualHeight($(".border")) }) </script> 回答1: You can use the window onresize event: window.onresize = setEqualHeight; 回答2: You can subscribe to the window.onresize event