Solved

trackbar

Posted on 2004-09-26
3
166 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
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
aelatik earned 30 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 42
Run code from text file in vb 1 64
Visual Studio 2005 text editor 10 38
Spell Check in VB6 13 112
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

808 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