realign dropdown box after form resize - winforms

I have a winform app. On the menu bar, far right, I placed a dropdown box on top of it. When I resize the form the dropdown box obviously stays in the same position (x,y location). How can I get it to move propotionally to the right when the form is resized. It basically stays on the same Y axis.
I can't use a layout control since it's placed on top of the menu.

You can use the Anchor property of the comboBox to do this. Simply set it to Right (probably Top and Right) through the designer.
Or to do it in code:
comboBox1.Anchor = AnchorStyles.Right;

Related

Nested scrolling inside Swiper in react

I have a vertical swiper where in one of the slides I have a box with overflowing Y content, I want the user to be able to scroll vertically within the box. But in both dektop and android mousescroll is not working. No scroll event is generating from within the box, and scroll is interpreted as swiping. I also have a multiline text field inside same slide but I am able to scroll in that, so it must be possible. How can I make it work the way I want to?

Follow up on: Rebuild list of containers without scrolling the list

Referring to this question and answer by Shai Almog:
Rebuild list of containers without scrolling the list
I have a form with one container (TableLayout), which contains several rows with labels and buttons. Clicking a button changes the order of the rows and rebuilds the whole form (after myForm.removeAll() ). After myForm.revalidate() the form jumps to the top.
I am trying to implement this exact behaviour, to return to the same point (scroll position Y) after revalidating/changing the container contents.
I subclassed the Container-class to make setScrollY(int) visible. Using this with an arbitrary value does not scroll to the position, so it seems that the setScrollY method is not changing the scroll position of the content pane overall.
And myContainer.getScrollY() always returns "0". I only get the scroll position by calling getContentPane().getScrollY().
But it is obviously not possible to call the setScrollY()-method on the content pane - as it is not possible to subclass the content pane - to scroll back to the same position after revalidating the form.
Thanks for any advice!
Use border layout which disables the scrolling of the form/content pane.
Place your container (where you exposed setScroll) in the center and make sure to invoke setScrollableY(true) on that Container.

Telerik RadDock on left side of main form in Winform application

I have a WinForm application that I would like to add a RadDoc like a popup menu on the left inside form main.
The user should be able to hover to the left side of the screen or click some tab on the left side of the screen and then the menu bar will appear.
The RadDock control itself does not have a auto hide.
I can hide the ToolWindow inside the RadDock but this leaves a blue background where the ToolWindow would show.
Also, when the ToolWindows are "AutoHide" they are tabbed at the bottom but they need to be tabbed vertically on the left.
The last thing is that I can't seem to set the "popup" size of the ToolWindows.
I would suggest that you go through the RadDock documentation.
Auto Hide article: http://www.telerik.com/help/winforms/dock-architecture-and-features-auto-hiding-windows.html
Arranging windows: http://www.telerik.com/help/winforms/dock-architecture-and-features-arranging-dockwindows.html
Modifying windows size: http://www.telerik.com/help/winforms/dock-object-model-example-building-an-advanced-layout-at-runtime.html
To make the whole control collapsible, you can use the RadCollapsiblePanel control: link.

How can I fix location of a child control in form?

I have a button and I want it to be always at the same location on my form (top-left corner of visible part of the form).
Here is the example:
So when I scroll vertically or horizontally, the button should always be at the top-left corner and it should be visible.
What should I do to make it fixed?
I guess you are using Form's AutoScroll feature.
What about placing Panel with AutoScroll = true on the form and use its scrolling instead? Then you will be able to place a button on a form but over this scrollable panel. So, the scroll rulers will scroll the view panel contents, but the button will stay pinned to the form.
If you don't want to add another container component, then you can add a handler on Scroll event and adjust the button position in response to form scrolling. The ScrollEventArgs argument has ScrollOrientation, NewValue and OldValue to calculate new X/Y position of the control.
On the form, you place a Panel and set: its Dock property to Fill, and AutoScroll property to True.
You place all the other controls inside this panel, but not the button you want to keep visible.
Right-click on the panel->Send-to-Back.
The Panel will adjust the size to match the form; the scrolling will only happen in the panel, so the button will always stay visible(you can set Anchor:Left,Top on it)
In order to be able to scroll(with the mouse wheel), the focus must be on a control inside the scrollable area(inside the Panel), NOT on the button. To prevent the button from getting focus: set TabStop to false on it; also, when it is clicked, you must also set the focus on an other control, by calling:
this.SelectNextControl(the_button, true, true, true, true);

How to scroll an extjs panel towards right

I have an extjs panel. This panel has dynamic contents added into it every time I press a button. This dynamic content gets added to the end of the panel, which is not visible until I do a manual horizontal scroll.
I want to scroll to the right most side everytime a new content is added and user see that content immediately (without manually having to scroll right)
Is there any way, I can automatically horizontally scroll the panel towards the end of the panel in the right
Thx

Resources