[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

trackbar

Posted on 2004-09-26
3
Medium Priority
?
172 Views
Last Modified: 2008-02-26
Hello

My trackbar and progress bar need to have 10 increments each and when i move trackbar, progress bar needs to move to the same location.

I wrote the code below, but I can only move a trackbar with it only 1 increment and then it stucks. Can you please advise what is going wrong in here. Thank you

    Private Sub tbrSlide_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbrSlide.Scroll

        Do While tbrSlide.Value < tbrSlide.Maximum
            pbrPercentDone.Value = tbrSlide.Value
        Loop
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        tbrSlide.Maximum = 10
        tbrSlide.Minimum = 0
        tbrSlide.TickFrequency = 1
        pbrPercentDone.Step = 1
        pbrPercentDone.Maximum = 10
        pbrPercentDone.Minimum = 0
    End Sub
0
Comment
Question by:Gipsy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
aelatik earned 120 total points
ID: 12153998
Why a do WHILE loop ? Or did i understand the Q wrong ?  

    Private Sub tbrSlide_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbrSlide.Scroll
        pbrPercentDone.Value = tbrSlide.Value
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        tbrSlide.Maximum = 10
        tbrSlide.Minimum = 0
        tbrSlide.TickFrequency = 1
        pbrPercentDone.Step = 1
        pbrPercentDone.Maximum = 10
        pbrPercentDone.Minimum = 0
    End Sub
0
 

Author Comment

by:Gipsy
ID: 12154022
thank you, dont know why.....i just didnt think it is that simple! what about setting 10 increments, do you think the setup i have allows 10 increments?
0
 
LVL 14

Expert Comment

by:aelatik
ID: 12154033
don't understand what you mean with "increment" because that is already happening here.
But you can change every setting. But do it this way ( this way you only need to adjust the slider settings ) :


    Private Sub tbrSlide_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbrSlide.Scroll
        pbrPercentDone.Value = tbrSlide.Value
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        tbrSlide.Maximum = 100
        tbrSlide.Minimum = 0
        tbrSlide.LargeChange = 10
        tbrSlide.SmallChange = 1
        pbrPercentDone.Maximum = tbrSlide.Maximum
        pbrPercentDone.Minimum = tbrSlide.Minimum
    End Sub
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question