Results 1 to 6 of 6

Thread: Weird Error Occuring!

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Weird Error Occuring!

    Hi Peeps,

    I have wrote an application which has several panels on and several text boxes on each panel. I use back and next buttons to bring to the front the relevant panel. It works great but after going in and out several times I sundenly get an error 'MAke sure you have not released a resource before attempting to use it'. The weird thing is I can be clicking into a textbox and it appears. I open the form with dim frm as new formname and then frm.show. I shut for form down by frm.dispose.

    Any idease please,

    Jiggy!

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Weird Error Occuring!

    OK I can shed some more light on this one. Basically in the got focus of my bottom textbox I call this sub routine:-

    Code:
        Public Sub MoveControls(ByVal InputPanel As Microsoft.WindowsCE.Forms.InputPanel, ByRef Panel As System.Windows.Forms.Panel, ByVal iHeight As Integer)
    
            Dim iControlCount As Integer
    
            For iControlCount = 0 To Panel.Controls.Count - 1
                If InputPanel.Enabled Then
                    Panel.Controls(iControlCount).Top = Panel.Controls(iControlCount).Top - iHeight
                Else
                    Panel.Controls(iControlCount).Top = Panel.Controls(iControlCount).Top + iHeight
                End If
            Next
    
        End Sub
    Which basically passes the current panel in and move the controls up and on the lost focus it calls it again and moves them down again. If I then exit the form and go back in; as soon as I click on one of the text boxes I get that error?????

    Help!!!!
    Please!!!

    Jiggy!

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Weird Error Occuring!

    OK I now know what is happening. On the last control of my tab in the got focus I call the routine above which moves the controls up (GREAT). I then close the keyboard which calls the same routine but this time all the controls move down (GREAT). I then click on a finish button which prompt me to save; after selecting either yes or no it then sets focus back to my last control so it call the routine again. Basically I think it is getting into a look causing memory problems. Is there a simple way to not allow focus back to that control once I have tabbed away from it.

    Thank you for any help,

    Jiggy!

  4. #4
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Weird Error Occuring!

    How about in the finish button, just before the selection of yes vs no, set the focus explicitly to something safe. Then after the selection is made, focus should return to that safe control.
    My usual boring signature: Nothing

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2006
    Posts
    1,806

    Re: Weird Error Occuring!

    Hi Mate,

    Thanks for the reply, I have stopped it happening by disposing the inputpanel as when they click on the finish it closes the form anyway. But the weird thing is that when the form has unloaded the keyboard still pops up on my menu form.

    Jiggy!

  6. #6
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Weird Error Occuring!

    EDIT: Oops, wrong thread.
    My usual boring signature: Nothing

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