Memory Error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SmVycnk=?=

    #1

    Memory Error

    using VB express, I have a form with 18 pictureboxes in that form, I load BMP
    files into the pictureboxes, when I first run/debug the program it runs, then
    I start getting memory errors, if I try and save it or run it again, anybody
    know why this is?
    Thanks,
    Jerry
  • Cor Ligthert[MVP]

    #2
    Re: Memory Error

    Jerry,

    Without your code we cannot see much, probably for the VB code is a better
    newsgroup

    news:\\microsof t.public.dotnet .languages.vb

    Cor


    Comment

    • =?Utf-8?B?SmVycnk=?=

      #3
      Re: Memory Error



      "Cor Ligthert[MVP]" wrote:
      Jerry,
      >
      Without your code we cannot see much, probably for the VB code is a better
      newsgroup
      >
      news:\\microsof t.public.dotnet .languages.vb
      >
      Cor
      >
      >
      Public Class form1
      Dim picCount
      Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
      System.EventArg s) Handles MyBase.Load

      Timer1.Interval = 1000
      picCount = 0
      Timer1.Enabled = True


      End Sub

      Private Sub Timer1_Tick(ByV al sender As Object, ByVal e As
      System.EventArg s) Handles Timer1.Tick
      Select Case picCount
      Case 0

      PictureBox1.Ima ge = PictureBox1.Ima ge
      picCount = 1
      Case 1

      PictureBox1.Ima ge = PictureBox2.Ima ge
      picCount = 2
      Case 2

      PictureBox1.Ima ge = PictureBox3.Ima ge
      picCount = 3
      Case 3

      PictureBox1.Ima ge = PictureBox4.Ima ge
      picCount = 4
      Case 4

      PictureBox1.Ima ge = PictureBox5.Ima ge
      picCount = 5
      Case 5

      PictureBox1.Ima ge = PictureBox6.Ima ge
      picCount = 6
      Case 6

      PictureBox1.Ima ge = PictureBox7.Ima ge
      picCount = 7
      Case 7

      PictureBox1.Ima ge = PictureBox8.Ima ge
      picCount = 8
      Case 8

      PictureBox1.Ima ge = PictureBox9.Ima ge
      picCount = 9
      Case 9

      PictureBox1.Ima ge = PictureBox10.Im age
      picCount = 10
      Case 10

      PictureBox1.Ima ge = PictureBox12.Im age
      picCount = 11
      Case 11

      PictureBox1.Ima ge = PictureBox13.Im age
      picCount = 12
      Case 12

      PictureBox1.Ima ge = PictureBox14.Im age
      picCount = 13
      Case 13

      PictureBox1.Ima ge = PictureBox15.Im age
      picCount = 14
      Case 14

      PictureBox1.Ima ge = PictureBox16.Im age
      picCount = 15
      Case 15

      PictureBox1.Ima ge = PictureBox17.Im age
      picCount = 16
      Case 16

      PictureBox1.Ima ge = PictureBox18.Im age
      picCount = 17



      'if you want it to start over change piccount = 0 vice 17
      End Select
      End Sub


      Private Sub PictureBox1_Cli ck(ByVal sender As System.Object, ByVal e As
      System.EventArg s)

      End Sub
      End Class

      Comment

      • Cor Ligthert[MVP]

        #4
        Re: Memory Error

        Jerry,

        I don't see any error in the code, however I assume that it takes some
        times. Mostly it helps in these cases to set your timer to disabled when you
        start the case select and to enable it again at the end, can you try that?

        You know that especially for the "case select" the newsgroup

        news:\\microsof t.public.dotnet .languages.vb is probably a better place.

        Cor

        Comment

        • =?Utf-8?B?SmVycnk=?=

          #5
          Re: Memory Error

          What I noticed is that when it error out, it would not allow me to save my
          program, so bmps loaded into picturebox 9 - 18 did not save into program, so
          I tried to put the bmp's into the pictureboxes and build it thats when I get
          the error, as if too many pictures?

          "Cor Ligthert[MVP]" wrote:
          Jerry,
          >
          I don't see any error in the code, however I assume that it takes some
          times. Mostly it helps in these cases to set your timer to disabled when you
          start the case select and to enable it again at the end, can you try that?
          >
          You know that especially for the "case select" the newsgroup
          >
          news:\\microsof t.public.dotnet .languages.vb is probably a better place.
          >
          Cor
          >

          Comment

          Working...