|
-
Jul 25th, 2007, 03:09 PM
#1
Thread Starter
Frenzied Member
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!
-
Jul 25th, 2007, 03:43 PM
#2
Thread Starter
Frenzied Member
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!
-
Jul 25th, 2007, 04:24 PM
#3
Thread Starter
Frenzied Member
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!
-
Jul 25th, 2007, 06:53 PM
#4
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
 
-
Jul 26th, 2007, 07:30 AM
#5
Thread Starter
Frenzied Member
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!
-
Jul 26th, 2007, 05:28 PM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|