vb6.0 help Urgent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kumar_ps
    New Member
    • Apr 2006
    • 19

    vb6.0 help Urgent

    I am using this code for when i scan more than one page in my application. if we click previous page button it shows previous page. but present i need code for next page.




    If n_ImageCount > 1 Then
    n_ImageCount = n_ImageCount - 1
    cpapidrawimage PicImage.hWnd , g_Image(n_Image Count)
    Else
    MsgBox ("This is last page")
    End If
  • BSOB
    New Member
    • Jul 2006
    • 77

    #2
    you would need a function to return the number of pages scanned in so far. either count each time this sub runs or have a static veriable that just adds one each time one is scanned.

    maxscanned

    If n_ImageCount < maxscanned Then
    n_ImageCount = n_ImageCount - 1
    cpapidrawimage PicImage.hWnd , g_Image(n_Image Count)
    Else
    MsgBox ("This is last page")
    End If

    not that i changed the ">1" to "<maxscanne d"

    determining the number of scanned pages depends on the rest of your application

    Comment

    • kumar_ps
      New Member
      • Apr 2006
      • 19

      #3
      Thanks for u r responce n_imagecount is the variable that count no of pages we scan. so can u give me full explanation... how to declare maxscanned...

      Thanku


      Originally posted by BSOB
      you would need a function to return the number of pages scanned in so far. either count each time this sub runs or have a static veriable that just adds one each time one is scanned.

      maxscanned

      If n_ImageCount < maxscanned Then
      n_ImageCount = n_ImageCount - 1
      cpapidrawimage PicImage.hWnd , g_Image(n_Image Count)
      Else
      MsgBox ("This is last page")
      End If

      not that i changed the ">1" to "<maxscanne d"

      determining the number of scanned pages depends on the rest of your application

      Comment

      • BSOB
        New Member
        • Jul 2006
        • 77

        #4
        from what i can tell from your 4 or 5 lines of code, "n_imagecou nt" is not the number of pages you have scanned but it is the page number that you are currently veiwing. you need to have a variable (i chose the name maxscanned arbitrarily) that tells you how many pages you have total.
        each time you scan a page, add 1 to the variable maxscanned.
        to ensure that the scope is big enough, put

        Dim MaxScanned as integer

        in your general declaration section.
        you will then be able to return or set its value from anywhere on that form.
        im still leaving it up to you to use that variable as a running count of scanned pages. again i say that that depends on the rest of your code.
        my previous post still holds valid.

        Comment

        Working...