Results 1 to 12 of 12

Thread: pls suggest Scrollbar Values

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    pls suggest Scrollbar Values

    im using scrollbars in my form, i want to know what values i should keep for SmallChange and LargeChange to work it smooth.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: pls suggest Scrollbar Values

    That would depend on the size of your form and how much scrolling needs to be done.

    How large is it?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: pls suggest Scrollbar Values

    i have a picturebox which will be scrolled, and picture box(S) height and width will be changed itself at run time

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: pls suggest Scrollbar Values

    Quote Originally Posted by chunk
    i have a picturebox which will be scrolled, and picture box(S) height and width will be changed itself at run time
    Through your code or the Form's Resize event?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: pls suggest Scrollbar Values

    yes i have it on Resize event of Form

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: pls suggest Scrollbar Values

    I like the page method: LargeChange = picHolder.Height. picHolder is the container with the image inside of it. Each largechange event moves the image a "page" at a time. SmallChange can be LargeChange\10 and if value = zero, then make it one. This way smallchange is 1/10th of large change. But by making smallchange > 1, user must use the thumb to scroll single lines of the image.

    An option to allow finer control if smallchange>1, may be to check for mouse down on the change event & if, say the ctrl key was down, revert to single pixel movements? Just thinking out loud & would require some more thought.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: pls suggest Scrollbar Values

    i want my scrollbars to work as our Internet Explorer(S) explorer works with Small and Large change. what values i should set of them on design time

  8. #8
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: pls suggest Scrollbar Values

    Honestly, I don't think there is a magic formula. Each app will have its own requirement - Word will move maybe paragraphs at a time while IE may move IEFrames at a time. I think this is a designer's choice -- your choice. Setting them at design time is not the best option in my opinion. Scrollbars should always be adjusted to what needs to be scrolled.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: pls suggest Scrollbar Values

    ok i will try your previous solution to set at Run time

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: pls suggest Scrollbar Values

    Code:
    Private Sub Form_Load()
    Dim VSmallVal As Long, HSmallVal As Long
        VScroll1.LargeChange = PicBox.Height
        HScroll1.LargeChange = PicBox.Width
    VSmallVal = VScroll1.LargeChange / 10
    HSmallVal = HScroll1.LargeChange / 10
    If VSmallVal = 0 Then
        VScroll1.SmallChange = 1
    Else
        VScroll1.SmallChange = VSmallVal
    End If
    
    If HSmallVal = 0 Then
        HScroll1.SmallChange = 1
    Else
        HScroll1.SmallChange = HSmallVal
    End If
    
    End Sub
    i wrote this code. do you want me to make some changes in it?

  11. #11
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: pls suggest Scrollbar Values

    Chunk, it looks good -- do what feels right. Is the scrolling now more agreeable? If you are happy with it, that's all that counts really. Play with a small 32x32 image and a larger one, say 512x512 or larger.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2007
    Posts
    912

    Re: pls suggest Scrollbar Values

    sure i will try it

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