How to scroll by touch custom control? - c#

I have a custom control in a winforms C# application which looks like this:
PANEL
-label1
-label2
-label3
If I want to scroll with the mouse wheel, scrolls fine, even if I have the mouse over one of those labels. The problem comes when I want to scroll touching the screen.
If I touch the panel it scrolls just fine, but it doesn't if I touch over a label.
ps: actually labels are custom controls too.

Related

How do i make a ScrollViewer with buttons instead of scrollbar?

I'm making an online cinema UWP app and i need to implement horizontal "gallery" with movies. The app will be used on PC, Xbox and touch devices, so i need the scrolling to be working with mouse, arrow keys and touch scrolling with swipes.
Currently I'm using ListView with ScrollViewer, but it doesn't give me the intended result. I want mouse wheel to scroll vertically, but when pointer enters the area of ListView, it starts to scroll the View horizontally. Disabling horizontal scrolling, well, breaks everything, so this pure implementaion is not an option.
I like the way MS made horizontal gallery in Microsoft Store app. It's scrollable with touch swipes and keyboard, but mouse wheel does nothing. Instead, the view shows round arrow buttons on the sides of this horizontal list like this:
I want to make something like that, but can't find any tips for controlling the scroll manually. Maybe there's any similar controls I don't know about or docs for making such control?
It should not be a big deal.
Set the VerticalScrollMode="Disabled" , VerticalScrollBarVisibility="Disabled", HorizontalScrollMode="Auto" and HorizontalScrollBarVisibility="Auto". Then set those two buttons to left and right with vertically centered alignment.
Use the ChangeView Method in the Click event handler to programmatically scroll through the contents. That's it.

Scrolling using touch not working on Panel In c# windows 32 application

I am making win32 c# windows application on touch screen device. There is one form having width (800px) which has one panel(Main panel: width 780px). This panel has autoscroll true. I am adding panels(UserDetailRow: width 100px) to this panel dynamically(call an api, fetch data and draw controls on panel) . this panel contains name , address etc of user represented as labels.
suppose If my Api brings 30 records then 30 panels are drawn on main panel and scroll bar is visible. My problem is that scroller is working fine using mouse anywhere on Mainpanel.
But when I use touch to scroll then touch only works on area on main panel where UserDetailRow does not takes up space i.e. (780px-100px) if i swipe up or down on the userdetailrow panels the touch does not work.
How can i fix this?

Advantages of popup over panels in Windows Phone

I'm curious about Popup control in Windows Phone. For me, it's some kind of panel, that has IsOpen property. And I should used it, when i want to present some only in some defined context (e.g. button pressed).
But why not use just normal stack, or grid panel, and when use Visiblity when you want to hide, or show it? It's seems to behave the same.
You can change the Horizontal and Vertical position of the popup using the HorizontalOffset /VerticalOffset properties in the Popup control. We don't have that option in the Grid and to other panels.
It is an overlay. It doesn't break page layout as it shows above the main content.
While StackPanel or Grid should be added to main content and when they are shown they'll move other controls down.

c# smartphone-like scrolling windows forms panel movement

I will try to explain it: I'm making an touch app in windows forms. I have some panels with buttons inside. I would like to move ( right or left ) the panel when i click in any control inside the panel and move the mouse left or right. I would like to get the movement like smartphone scrolling.
I thought to make this with drag&drop and when I drag some control inside the panel, move the panel to right or left. But I don't know how to make this and I don't want to lose button's click because every button have their own functionality.
You have some idea?
Thanks a lot

Silverlight Scrolling Tab Control

I am wanting to create a sivlerlight tab control where the tabs remain on a single line and scroll buttons will allow me to scroll left or right through the tabs. Below is a link to a control that can be purchased but I would like to write my own and share it with the community. I know I can create a inherited class and style with buttons for the tab control. I guess I am confused on how to keep the tabs on one line and scroll the tabs so only half of a tab would be shown. Can you all help with this? If I way off base please correct my direction.
Sample tab control
Recently I have created the TabControl in which the tabs are situated on the single line.
I have written the blog post where I've explained some details.
Also you can download the project directly here.
My first instinct would be to create a control that has a ScrollViewer with a WrapPanel inside it (from the Silverlight Toolkit) that is flowing horizontally. Then you can add the tab buttons to the flow panel and you should have the scroll behaviour.
Of course, if you don't want a scroll bar but instead want buttons, you can do the same thing but hide the scroll bars, then embed the whole thing in a Grid with three columns. Have the ScrollViewer sit in column 0 with a columnspan of 3 and then add a button to columns 0 and 2 that you can show and hide when the mouse rolls over that cell of the grid. You could then somehow scroll the viewer when the buttons are pressed.

Categories