PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

eVB Newbie

im just starting to learn to program with eVB and ive got a problem. I need to close one form and open another. to do this, ive been using this

Code:

Private Sub cmdForm_Click()
form2.Show
form1.End
End Sub


when i run it and tap on cmdForm - a button -, the screen rapidly switches between form2 and form1. please help me!
Try doing this:

form1.hide
form2.show

What's happening with your code I think is that your showing the second form, but doing form1.end is quickly passing focus back to form1. You need to hide the first form, then show the second (there is also a difference between hiding a form and closing or destroying it, you could do some things with that fact as well).
that made things even freakier.
i run it, form1 loads, i click on cmdForm, form1 hides, and the text box for form2 shows up, but in the programs folder (the one with the large icons it was running in the background) and then form1 reappears. and also how do i actually close a form?

and i was using form1.hide, not form1.end just a typo when i posted
Here, give this a try:

http://www.omnytex.com/VBTest.zip

That I think does what you were asking for. Let me know if you have trouble with it.

With regard to how to exit a form, I'm a bit rusty in VB, but I think it's Unload <formname>.
Your example worked, but the unload didn't. maybe i had the wrong syntax

and now evb's giving my errors whenever i try to debug, something about being unable to attach remote CE debugger
fzammetti · 13 Jun 2002, 18:55 UTC — I didn't know...
This is news to me, but here it is, straight from the eVB documentation:

"Although eMbedded Visual Basic supports the use of multiple forms using the Show and Hide methods, the Unload statement and the Unload event are not supported. This means that whatever forms get loaded stay resident until the application closes; thus, the fewer forms your application has, the more efficiently it will run."

So, the answer is to do what I did in the example, it appears to be your only choice.