ScrollView in a Code Module???

JaunLukePicard

Member
Licensed User
Longtime User
For several reasons I am thinking about trying to create a Code Module that builds a ScrollView based upon variables I supply. I think this is possible?

1. Reduce amount of code to create many ScrollViews
2. Standardize ScrollView display parameters
3. Quicker build of new screens
4. Reduced complexity

In an application there can be many ScrollViews depending on the complexity of the application. A Code Module that builds ScrollViews would really help speed developement up.

If I indicate that I want X number of columns they will be created with the width I supply, etc. And if I pass information regarding the data to populate those columns.

Any ideas please.....?????:sign0085:
 
Last edited:

kanaida

Active Member
Licensed User
Longtime User
This sorta goes back to what I was saying before about us needed to be able to build classes eventually. However what I have done to do what you are talking about is made subs that take a scrollview or any other view as a parameter itself so you can call them like this:
I mean the params are up to you, but that's how I added custom items laid out in a scrollview like 3 images in one row etc... it's more complicated than that, but it eases some placement issues by using global variables at the top. It's a bit spaghetti like, but much less so than doing it by hand.

Sub PopulateScrollview

CodeModule.PopulateItems(Scrollview1,SomeItems(),"style1")

End Sub
 
Upvote 0

JaunLukePicard

Member
Licensed User
Longtime User
ScrollView in a Code Module??? Classes

kanaida,

YES! That is exactly what I want to do. So far I have used subs in a Code Module to build elements of the ScrollView by passing the parts of the ScrollView (panels). At least passing the panels affords the ability to work with "chunks" of the screen, if you will.

Could we pass the entire set of Views as a Type? I will try this next. With a Type we can include all of the elements used for the Layout in one parameter or even a parameter array.

 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes I find types make grouping this kind of information much tidier and more readable.
 
Upvote 0

JaunLukePicard

Member
Licensed User
Longtime User
I was successful in getting Types and Lists to work for my purpose. They help out a great deal. I used a few posts here to get started.

Now I have created a Code Module just for the ScrollView. I am working right now to pass the variables into the Code Module to build a ScrollView dynamically. This Code Module will allow the Developer to make the ScrollView accept properties from either Free Form, Database or CSV file.

The Code Module will have several Subs and could be a couple hundred lines in the end, but to create the Views themselvs will require less then 20 lines of code typically. - Estimates for now.

I have also started documenting the work. I have to take this step now before I can really crank out my application because it will use quite a few ScrollViews among other things.

I think I will need to adapt the Code Module for the ListView or even HorizontalScrollView as needed.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…