Click to See Complete Forum and Search --> : Good resources?
cnjmorris
Sep 20th, 2004, 12:42 AM
Anyone know of any good resources for VB.NET and the compact framework?
The MSDN almost always includes nothing but examples of C# or despite my CF filter I get articles that only apply to the full .net framework.
I am trying to create a multiple form application but I want the first form to close when the second opens. I am sure this is a novice question but I have 10 days to wait before the books I ordered get here =)
The only example I found, which apparently is a nice example, is purely in C# of course.
Mike Hildner
Sep 20th, 2004, 11:02 AM
Seems like there's not a whole lot of resources for .NET CF, or at least not as many as for the full framework.
What do you mean by close the first form? Does it really make a difference? I mean, you can close it if you want, but the way CF is designed, things (application, forms etc.) aren't meant to be closed. That's a quick, lame explanation, BTW. Once you show your second form, it will take up the whole screen.
Not sure what you're after, but I could probably whip up a VB app that closed Form1 then opened Form2, if you think that will help.
Mike
cnjmorris
Sep 20th, 2004, 12:38 PM
Okay the biggest annoyance for me currently is the fact that both forms show up in the 'running programs' list. I guess there isnt any getting around that. Most programs I have seen do that, like when asking for registration and the like.
I definitely want to close the first because it is a splash screen, which is just a nice way of saying that the second form loads slow and I don't want users to think nothing is happening. However I will have to open another form later, maybe two.
I have used panels already to avoid a new form. I can only have so many panels though.
If you know how to close a form and could tell me that would be great, or point me that direction. I'll be honest, I don't know a lot about inheritence. It took me a while to realize how I need to declare and then call the second form. I just can't get the first to close yet.
Thanks.
Mike Hildner
Sep 20th, 2004, 12:56 PM
There's probably a lot of ways to do the splash screen thing, depending on what it does. Here's just a quick try, using sub main rather than the form as the start up object. Form2 would be the splash screen, Form1 the main app.
Public Shared Sub main()
Dim f2 As New Form2
f2.Show()
Application.DoEvents()
System.Threading.Thread.Sleep(5000)
f2.Close()
Application.Run(New Form1)
End Sub
HTH,
Mike
Mike Hildner
Sep 20th, 2004, 01:06 PM
Reading your post again, if there's a lot of stuff going on when you load your main app, that code probably won't work for you, because you'd still have the delay. Maybe something like this would be better.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim f2 As New Form2
f2.Show()
Application.DoEvents()
' Do some lengthy process
System.Threading.Thread.Sleep(5000)
f2.Close()
End Sub
This of course is using Form1 as the startup object and not sub main.
cnjmorris
Sep 20th, 2004, 01:33 PM
Well, actually, the 'splash screen' is where the user chooses an entry date. When they click on the button it fires a panel that fills the whole screen, and says something like 'loading...' while the other page loads with the data requested by the date chosen.
The program is a Type II Diabetes management system, that tracks glucose levels, medications, diet, weight changes, and excercise. I looked for a long time and never found a good one. So I'm making one. =)
Thanks for the help. I'll give your input a try and see if it works for what I need.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.