Scrollbars automatic centering - c#

I have a Form with height size bigger then screen, so the user can use the scrollbar to see the content. My problem is, I have alot of buttons and checkboxes, all the way up and down the form, and every time the user try to click some, the form automatic try to center the clicked button in the middle of screen.
I want the scrollbar to stay where the user put it. And not trying to automatic center at every btn or iten clicked.
Can someone help with this? Its winforms, visual studio 15.

I cannot reproduce your problem but have you tried overriding the ScrollToControl?
Stop form from scrolling when moving controls

Related

how keep a control in windows form's view if scroll happened?

i have a Form and it have a very big dataGridView(please ignore the datagridview) and so many other things. my Form is maximized and i set AutoScroll True and there is a Button on top of the Form when i scroll down Button goes out of user's view. i wanted to be like fix position in HTML so i tried to use VerticalScroll.Value somehow for Button.Location.Y in Form Scroll event but it didn't go well because i even don't know how this value of VerticalScroll will be calculated and have it nothing to do with Form.Height or not and the max value(when scroll is at bottom of form) is changing when you resize the Form.
have anybody any suggestion or solution for this?

Setting Winforms C# panel VerticalScroll.Value property to 0 is not having any effect

I'm having an issue where my scrollbar for a panel on a usercontrol always appears at the bottom.
If I hover the mouse over the tab and cause the control to slide out and be shown, the scrollbar is at the bottom. If I then move the scrollbar to the top and move the mouse off the control (which causes it to hide again) and then move the mouse back over the tab (which causes the control to slide back out) the scroll bar is back at the bottom!
Setting the VerticalScroll.Value property on my panel to 0 is not having any effect - the control still shows at the bottom. Can someone tell me what events might fire when a control slides back into view on an autohide tab or just tell what I could do to solve this issue! I assume that the Paint event is what fires when the control is shown but I'm not entirely sure.
I did notice that in the VS designer that the scrollbar by default is shown at the bottom. Not sure whether this may have anything to do with the issue?
Any suggestions appreciated!
Try this:
scrollingCtrl.VerticalScroll.Value = 0;
scrollingCtrl.PerformLayout();

On click event, Silverlight child window resize to show more options

I have a Silverlight child window in place,
however I want to hide certain options i.e. check boxes from the user until a specific item on the current form is clicked.
Once that item has been click I need the window to resize dynamically to show the checkboxes down the side of the window. I believe this would be using an animation to make the transition smooth however I have no idea if this is even possible?
Any insight would be appreciated.
try using an accordion or an expander control, they have the functionality to animate grow and shrink the specific content they contain! Hope that this solves your problem

When I draw a button, it snaps back to the middle of the screen?

I'm very new to WPF. I was trying to add a button to a tab item (of a tab control I had already dragged in) in Visual C# 2010 Express. Upon doing this, the button repeatedly snapped to the center of the screen when I tried to drag-and-drop reposition it. Why is this happening, and how can I move the button? I haven't written any code, and the only properties of the button that I've changed are the size, content, and name.
I had the same/similar problem today. In my case the designer had created a <border></border> around my button, with size equal to the whole application window. So, when I was moving my button around I was actually moving the border and the button and the border was snapping to the application and the button - to the border. When I removed the border - all was fixed.
Diagram explanation
See if you have such a border or other encapsulating element which may cause this behaviour.

Buttons are not visible in winform application

We have a wierd issue here.
We have a win-form application. The application has a tabbed form with few textboxs, combo boxes and 3 bottons. The application runs fine in most machines but in 1 machine the buttons are not visible .
Rest all are working fine. Just the buttons are invisible. But the button is present as Iam able to fire the event using tab and enter.
We have checked the log.but cannot find any exceptions logged.
We have checked various resolution but didnt help.
Any help ?
Buttons are at the bottom of the screen just above the taksbar. Taskbar is visible.
We have checked the dotnet frame work .Its fine
Issue is found in a Vista Machine
Thanks in Advance
My guess would be that the one machine has a different DPI setting. Perhaps it's pushing the buttons more downwards than they're supposed to be and that causes the buttons to disappear beneath the border of the form?
Also, I'd check the buttons' Anchor property to see where they're anchored to and that they're not moved around by weird window size to behind something else.
It could be that the buttons are not included in a tab which is on top of the buttons. Try making tabs (or various other controls) invisible to make sure the buttons not being obscured.
Setting the WrapContents to false on the FlowLayouPanel we were using, fixed a very similar issue.
The Buttons were near the bottom edge of the dialog box and would disappear in certain monitors resolutions. I think the WrapContents=false clips the buttons than completely removing them.
In my case I had login Panel where the height of it was depending on Main Form size, For example the height was Form size * 0.1.
The fix was to make the Login Panel resize its size depending on its components by setting loginPanel.AutoSize = true;

Categories

Resources