in VB.net, how do I get a panel to scroll on a touch screen? - vb.net

I have a panel which has a vertical scroll bar on it. Inside the panel are several DataGridViews. When I use the application on a touch screen such as the Lenovo ThinkPad, I'd like to be able to move the whole panel up or down by sliding my finger up and down the screen. However, this doesn't happen. If I touch the screen, I can select an individual row on a data grid. Or if I touch the slider on the side, I can make the screen move up and down just as if I was using a mouse, but apart from that, I can't make the panel move.
If I use my browser, and the page is larger than the screen, then I can use my finger to slide the entire page up and down. I realize that this is a browser and not a Windows forms application, but that is the functionality that I need.
My app is a Windows Forms application.
Thanks.

You could make a new form, turn AutoScroll on there and stretch it to the width of your choice.
Then in your other form your simply add it as control in your panel.
Example (Form1 = Main Form, Form2 = AutoScroll Form, Panel1 = Your Panel):
Sub Form1_Load(...) Handles MyBase.Load
Dim ScrollFrm As New Form2()
ScrollFrm.TopLevel = False
Panel1.Controls.Add(ScrollFrm)
ScrollFrm.Dock = DockStyle.Fill
ScrollFrm.Show()
End Sub
Hope that helps :)

I ended up using this link to put my answer together. I had to make a few slight modifications to suit my needs, but the basic idea was the same.
how to get smartphone like scrolling for a winforms touchscreen app ( scrolling panel )

Related

How to make VB.NET application full screen without moving my controls

I want to make my application so that when it has been maximized the control will automatically position itself it the right place.
Assuming that this is a WinForm project, you need to set the Anchor property of the button to Bottom, Right.
The most useful control is the TableLayoutPanel. You should put all the controls on the panel -> set dock: Full and every time the form resized, the controls stay in their container.

Using vertical scroll with tabcontrol

I am using Visual basic 2010 for coding. I have develop the code on desktop. Where I have adjusted form as per my desktop screen. I am going to run the application on Laptop. When I run the app the screen is not fitting to Laptop screen. SO I deciede to include vertical scroll. If moved up and down we can see all the parameter.
How can I do it?
I have added image for reference.
The scroll bar(s) should be inside the individual TabPages. You should set the Anchor and/or Dock properties of the TabControl so that it resizes with the form and set the AutoScroll property of each TabPage to True if you want it to display scroll bars if and when any of its child controls are outside its viewable area.

panel autoscroll turns off when switching between windows

I created an interface it has several forms you can switch between using a panel as the parent form. My problem is that when i switch between my forms on the second time i open a form if that form has autoscroll on a panel it will not allow you to scroll and the window is stuck on the view you previously had.
In this image i open the form internet. after doing so i will click on instruction( any form switch triggers this)
now i open the same form again and the scroll bar is gone and it locks in on the last position the form was in.
the very curious thing in this is that this only happens on the internet form word also has a scroll bar however even though the properties and settings for both are identical only one does not work.
What could be causing this and how do i go about troubleshooting errors like this.
The forms are removed from the panel and re-added, they are not closed.
Assumption 0:
The forms are removed from the panel and re-added, they are not
closed.
Store the state of panel autoscroll and set it after you have re-added it. Note that if you add controls to the panel first and panel is not docked, then scroll will not appear because panel dimensions can be huge. You should set following property as well:
vScrollBar1.Vericalscroll.Value = 0
Assumption 1:
I assume what is actually going on is that you do not add controls to that panel, but to the form behind it or something similar. In that case - program is correct, you just asked it to do a wrong thing.
Assumption 2:
Assuming is panel is anchored top, left, bottom, right. There is currently a limitation in Windows Forms that prevents all classes derived from ScrollableControl from acting properly when both RightToLeft is enabled and AutoScroll is set to True.
Manual : link
Assumption 3:
You add the controls back, by recreating them, but forget to add handlers or create them in order where scrollbar is out of view. Instead of absolute positions you could use dockstyle:
Dim vScrollBar1 As VScrollBar = New VScrollBar
vScrollBar1.Dock = DockStyle.Right
Controls.Add(vScrollBar1)

Windows Phone 8.1 Create a Swipeable Scrollable Control

I am trying to create an animation to a control.
So think of the animation and control of a now playing page on most touch screen devices. You see the control (album photo) and swipe either way and get it to slide off the screen and then the next control (album photo) slides on in its place.
I am not asking for you to code me this, but I am having trouble wrapping my head around a way that this could be done.
The control content is always changing, when you swipe one way, an image is removed from the view and then the next is added.
What you need is FlipView control which can get you the interface you described.
Here are some references:
Quickstart: Adding FlipView controls (XAML)
XAML FlipView control sample

how to fix a menu at the top opf the form in vb.net

I am developing the application using VB.Net, in that i am using the menu. but the menu is not visible when the form is scrolled down. how can i fix it?
I think you are looking for the Dock property:
MyMenuControl.Dock = DockStyle.Top
"Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent."