Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have a flowlayoutpanel in my form, fixed size, and i fill it dynamically with user control instances of fixed size. I know how to make it scrollable "standard way" by mouse and scrollbars but my question is this. Can you in some fairly easy way implement "smartphone like scrolling" when app is executed in touchscreen environment (it will only be used there). I have looked around and seen some questions similar but not exactly what im looking for. I want to be able to , by finger, "grab" and move (scroll) the list of user control instances like you would scroll in your email client in a smartphone. I hope im being clear enough in this question.

What I have tried:

I have not yet found anything to try
Posted
Comments
Wessel Beulink 4-Nov-16 11:31am    
You simply can't with fixed height. Set the height by default or with javascript or jquery based on screen height. And set the overflow on scroll.
Thats the only way to get this workaround.
Member 9833426 18-Nov-16 1:44am    
Im not a professional programmer. I do programming when need occurs, hence i could do with a little bit more explanation on how you propose to solve this.
Rgds
Thomas
Wessel Beulink 18-Nov-16 2:02am    
Paste down the code and css you are currently using than i'll change it for you.
Member 9833426 25-Nov-16 2:58am    
I dont really have any "handling code" for the flowlayoutpanel. Its set to show scrollbar on the right. The total code is quite extensive so im pasting the populating flowlayoutpanel code. Usercontrol1 is a custom rectangular horizontal control of fixed size and the panel receives quite a few of them. I would love to achieve "smartphone email type scrolling" by touch.

Code:
=====

private void flowLayoutPanel1Populate(string obj)
{
//Fyll på flowlayoutpanel med valda objekt som skapas från infoClass listan
UserControl1 ucx;
if (obj != "Visa alla objekt")
{
for (int i = 0; i < objectList.Count; i++)
{
if (objectList[i].mainObjectName == obj)
{
ucx = new UserControl1(objectList[i].mainObjectName,
objectList[i].caption,
objectList[i].extText,
objectList[i].mainFtext,
objectList[i].okFtext,
objectList[i].ktrlFtext,
objectList[i].ukFtext,
objectList[i].okQuickSel,
objectList[i].ktrlQuickSel,
objectList[i].ukQuickSel,
objectList[i].linkText,
objectList[i].linkPath,
objectList[i].indexInList,
objectList[i].state);
flowLayoutPanel1.Controls.Add(ucx);
}
}
}
else
{
for (int i = 0; i < objectList.Count; i++)
{
ucx = new UserControl1(objectList[i].mainObjectName,
objectList[i].caption,
objectList[i].extText,
objectList[i].mainFtext,
objectList[i].okFtext,
objectList[i].ktrlFtext,
objectList[i].ukFtext,
objectList[i].okQuickSel,
objectList[i].ktrlQuickSel,
objectList[i].ukQuickSel,
objectList[i].linkText,
objectList[i].linkPath,
objectList[i].indexInList,
objectList[i].state);
flowLayoutPanel1.Controls.Add(ucx);
}
}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900