Results 1 to 10 of 10

Thread: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

  1. #1

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    129

    [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    User Control: ucAddScroll.ctl
    Author: Shagratt
    Dependencies: ucScrollbar.ctl

    Name:  sScrollAdd_screenshotW71.jpg
Views: 582
Size:  24.6 KB
    Name:  sScrollAdd_screenshotW72.jpg
Views: 584
Size:  34.4 KB



    -What it does?: It create a scrollable area on the TARGET (Control/Form) with all it's content.
    It add 4 controls to the Form: (exposed in ucScrollAdd.xxxx)
    1) .PBContainer: The new container that will scroll inside the Target with all the the content.
    2) .UCScrollV: Vertical scrollbar
    3) .UCScrollH: Horizontal scrollbar
    4) .PBCover: A simple picture box put in bottom right corner between the scrollbars


    -What it dosnt?: It's not a scrollable container by itself. You need to create the
    content on a standard vb6 container (for example a PictureBox) or Form, wich has content
    larger than its viewable area. This means you can use an already made Form and add
    scrollable resize with just this control and 1 line of code.


    -Usage:
    1) Add a instance on the form.
    2) In your code call: 'ucScrollAdd.AddScroll <TARGET CONTAINER>' to automatilly add
    scrollbars when needed. (Example: ucScrollAdd.AddScroll Me)

    Optional:
    -call 'ucScrollAdd.TrackMouseWheel' to enable MouseWheel tracking over container area.
    (Press SHIFT to scroll horizontal)
    -call 'ucScrollAdd.ResizeWindowLimit <MINWIDTH>, <MINHEIGHT>,[MAXWIDTH], [MAXHEIGHT]'
    to add Form resize limit without flickering
    -call 'ucScrollAdd.RemoveFromContainer <CTRL>,[CTRL],[CTRL],...' to exclude all
    controls/containers you want from Scrolling.
    -If you want to know the size of content inside the container
    'CalcContainerContentSize maxBottom&, maxRight&' values are returned by ref.
    -propertys ContainerW/ContainerH can be used to force the size of the container


    NOTE: You can have more than 1 scrolling area in the form

    For better understanding check the included 4 examples in the project.

    ----------------

    *v1.0.0 11/12/19
    - Starting version. Basic usage working


    Download: prj (Ctrl) ScrollAdd_v1.0.zip

  2. #2

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    129

    Lightbulb Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Talking with Eduardo I realised that I did not explain well how to create this 'larger than screen' forms.

    You can use 2 simple methods:

    Method A)
    -Create a PictureBox with the size you want and put in Top: 0, Left: 0. This will be our container.
    Just for the example let's say our screen is 800x600 and we created a 800x1200 picture box called PBContainer
    (This mean we now have a picturebox with a Height of 2 screens)
    -Now add all the content you want on that picturebox (labels, others picturebox, images, textbox, etc.)

    -The problem: You can only see the first 800x600 part that fit on the screen.
    Fix: Move the picturebox (PBContainer) upward by dragging it or just changing its top to negative values.
    Let's put in half screen up moving it to Top: -300.
    Now we see the bottom half of the 800x600 we designed and the first part of the second.
    (what we see in the screen is the rectangle 0,300 to 800,900 from the PBContainer.
    -Keep adding controls and repeat moving it up until we have edited all the area we wanted.

    -When finished restore the Top: 0 , Left: 0 of the Picturebox
    -On Form_Load when calling "ScrollAdd.AddScroll me" and the form we will be
    able to access everything that was offscreen.


    Method B)
    -Create diferent picturebox (like PbA PbB, PbC)
    -On Form_Load put every picture box below the other
    Example:
    Code:
    PbB.top = PbA.top + PbA.height
    PbC.top = PbB.top + PbB.height
    ScrollAdd.AddScroll me

    All my examples and documentation was written in most used language in the world, and that is "BAD ENGLISH" , so if I was not clear enough feel free to ask

  3. #3
    Addicted Member
    Join Date
    Jun 2016
    Location
    Espaņa
    Posts
    147

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    very good job this great control.
    in the not too distant future will probably use
    Greetings

  4. #4
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,064

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Great! Although Demo is not really a web page, it seems to be a good web UI simulator! Hope that VB6 can be more and more applied to web development.

  5. #5

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    129

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Quote Originally Posted by dreammanor View Post
    Great! Although Demo is not really a web page, it seems to be a good web UI simulator! Hope that VB6 can be more and more applied to web development.
    Of course! The demos are just drawn to show the kind of UI design that can be accomplished with the usercontrol. No real functionality added. (I copied the style of a well known news webpage wich can be created with standard VB6 elements)
    I have in mind to create more controls to mimic more web UI functionality. Too many good ideas, too little time to make them

  6. #6
    Addicted Member
    Join Date
    Nov 2011
    Posts
    159

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    hi. been playing around with this control and it works very well.
    I did not like to bounce when i scrolled and found somewhere in the code and set it to 1 and not 0.15.
    this was more inline with a scrollbar i usually use.
    i also wanted a status bar at the bottom, and had to make a few adjustments in the code to leave a gap
    at the bottom of the form.
    Works real nice now.

    Many thanks.

    p.s will you be adding any other features etc

  7. #7

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    129

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Quote Originally Posted by k_zeon View Post
    hi. been playing around with this control and it works very well.
    I did not like to bounce when i scrolled and found somewhere in the code and set it to 1 and not 0.15.
    this was more inline with a scrollbar i usually use.
    The 'bounce' effect was expected :P but if you dont like you dont need to change anything in the code.
    Scrollbars have a property called 'SmoothScrollFactor' wich its pretty sure what you have modified
    You can change it from the ScrollAdd control with 'ucScrollAdd1.UCScrollV.SmoothScrollFactor=1' and 'ucScrollAdd1.UCScrollH.SmoothScrollFactor=1' (for the vertical and horizontal axis)


    Quote Originally Posted by k_zeon View Post
    i also wanted a status bar at the bottom, and had to make a few adjustments in the code to leave a gap
    at the bottom of the form.
    Works real nice now.
    Again no need to change the code. You can use 'ucScrollAdd.ResizeTargetOnFormResize X,Y' where X and Y are the padding left and bottom you want to leave when resizing.


    Quote Originally Posted by k_zeon View Post
    p.s will you be adding any other features etc
    There are a few bugs that I still not found. So aside from fix this bugs I dont think so, it's pretty much working as I spected.

  8. #8
    Addicted Member
    Join Date
    Jul 2017
    Posts
    208

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Very nice control shagratt .

    How about adding support to scrolling by mouse_down on the container itself that is being hooked to act like mobile phones scrolling . It will be so great for applications that run on touch screens so the user will not have to scroll using the scrollbar only .
    I don`t know if it should be added to UcScrollbar or the UcScrollAdd . Only you who can evaluate this .

  9. #9

    Thread Starter
    Addicted Member shagratt's Avatar
    Join Date
    Jul 2019
    Location
    Argentina
    Posts
    129

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Quote Originally Posted by Hosam AL Dein View Post
    Very nice control shagratt .

    How about adding support to scrolling by mouse_down on the container itself that is being hooked to act like mobile phones scrolling . It will be so great for applications that run on touch screens so the user will not have to scroll using the scrollbar only .
    I don`t know if it should be added to UcScrollbar or the UcScrollAdd . Only you who can evaluate this .
    Hi Hosam! That's a really cool idea! Thanks for sharing it! I will add it to the TODO LIST to make it in the near future. (working on another UC right now)
    Unfortunately I dont have any touchscreen to play with (but I could try test sharing my screen to my phone and use it as a touch monitor...)

    Even if right now the feature is not implemented I think you can capture the mouse down in your code and change the values of ucScrollAdd1.UCScrollV to mimic the drag.

  10. #10
    Addicted Member
    Join Date
    Jul 2017
    Posts
    208

    Re: [VB6] ScrollAdd Ctrl v1.0 (add scrolling to current forms and containers)

    Ok , I will see what I can come up with . Keep it up .

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width