resize

WPF Window - Only allow horizontal resize

走远了吗. 提交于 2020-01-12 12:09:09
问题 I want to only allow my WPF window to be resized horizontally. How best can I achieve this? 回答1: If you set the MinHeight and MaxHeight attributes of the window to the desired height the window will have a fixed height 回答2: If you want to use the MinHeight and MaxHeight approach but still allow the window to automatically size itself to fit the size of its content: <Window x:Class="MyWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

FlowLayoutPanel - Automatic Width for controls?

拥有回忆 提交于 2020-01-12 11:56:22
问题 is it possible to make the inserted items in FlowLayoutPanel automatic size of the FlowLayoutPanel? Here is an example: A form with 1 FlowLayoutPanel and 3 buttons inside: if I resize the form, the controls look like this: they arrange "left to right" What I want is this: The controls should have the width of the FlowLayoutPanel: Any Ideas how to do this? I changed the FlowDirection and played with the Anchor property but with no luck. I could of course Resize the controls in the

jQuery Manual Resizable DIV

天大地大妈咪最大 提交于 2020-01-12 08:47:11
问题 I'm trying to create a resizable div without using jQuery's interface library. var myY = 0; var mouseDown = false; var originalHeight = 0; function resize(e){ if(mouseDown == true){ $("#cooldiv").height(originalHeight+e.pageY-myY); } } $(document).ready(function(){ $().mouseup(function(e){ myY = 0; mouseDown = false; originalHeight = 0; $().unbind("mousemove", resize); }); $("#resizeBar").mousedown(function(e){ myY = e.pageY; originalHeight = $("#cooldiv").height(); mouseDown = true; $().bind

Stop the browser from pushing everything around when I resize

时光总嘲笑我的痴心妄想 提交于 2020-01-12 07:12:21
问题 How can I stop my whole site from falling apart while a user is resizing the browser window? The site looks perfect - it only gets all mangled when it is resized to a smaller size. 回答1: Put a fixed-minimum-width wrapper around it: Before: <html> <body> <!-- Your content --> </body> </html> After: <html> <body> <div style="min-width: 960px; margin: 0 auto;"> <!-- Your content --> </div> </body> </html> This will ensure that your page is always displayed as at least 960px minimum width (and

Dynamically resize columns in css grid layout with mouse

独自空忆成欢 提交于 2020-01-12 04:33:49
问题 I am trying to dynamically resize css grid layout boxes by dragging the column dividers (or resize placeholders) with the mouse. I set resize: horizontal; on the nav element to resize, and it gets resized when I drag the small resize handle in the lower right corner of the element, but the width of the neighbouring column is not automatically adjusted which leads to overlap. Here is a broken codepen. HTML : <main> <nav>#1</nav> <header>#2</header> <section>#3</section> </main> CSS : main {

How can I make my form resize more smoothly?

淺唱寂寞╮ 提交于 2020-01-11 15:51:08
问题 When resizing a form with many controls, the form looks bad because of flickering. What are some tips to have a smoother form resizing? 回答1: procedure TForm1.WMEnterSizeMove(var Message:TWMMove); begin Self.DisableAlign; end; procedure TForm1.WMExitSizeMove(var Message:TWMMove); begin Self.EnableAlign; end; 回答2: Try using WM_SETREDRAW (not LockWindowUpdate). You might also have a look at DeferWindowPos. 回答3: Complex forms are often made up of nested panels, and the repaint process may cause

Automatically grow document view of NSScrollView using auto layout?

随声附和 提交于 2020-01-11 15:39:08
问题 Is there a simple way to get an NSScrollView to adapt to its document view changing size when using auto layout? I have tried to call both setNeedsUpdateConstraints: and setNeedsLayout: on the document view, the clip view and the scroll view, without any results. fittingSize of the document view reports the correct size. The problem is that the document view, which holds subviews, is not re-sized when the subviews change their size, even if they call invalidateIntrinsicContentSize . The

How to move and resize the browser's window in Opera and Chrome?

被刻印的时光 ゝ 提交于 2020-01-11 09:59:54
问题 I was looking for a way to resize and move the browser's window and I've found these: self.resizeTo(w, h) and self.moveTo(x, y) - this seems to work perfectly, but only in Firefox and IE (tested with IE8, I don't know how it works in the previous versions). How can I force the same behavior (resizing and moving) in Opera and Chrome? In these browsers the above solution does not work at all. Just nothing happens and nothing appears in the error console. 回答1: In Opera and Chrome you can use

How can I prevent the user from resizing the silverlight out-of-browser window?

↘锁芯ラ 提交于 2020-01-11 09:44:29
问题 I have a silverlight app which can be installed as out-of-browser . I've defined the Height and Width in the main UserControl . I've defined the same Height and Width in the OutOfBrowserSettings.xml file. But the user can still resize the out-of-browser frame window. How do I prevent this? 回答1: The window hosting the Silverlight application cannot be controlled by the application when it is running with normal permissions, that would be a security issue. However, if you install the OOB

Java Swing drawing disappears when resizing window

有些话、适合烂在心里 提交于 2020-01-11 06:15:13
问题 i need your help badly because i cannot solve this problem on my own. I am trying to create a GUI and want to draw something in it after pressing a button, but i seem to have some kind of refresh/revalidate or threading issue. The drawing is painted, but when I resize the window, the painting disappears. Also, when moving the window very quickly, parts of the drawing disappear. I have tried many things, but I can't get this problem to work, maybe you can help me. I was instructed not to write