Results 1 to 6 of 6

Thread: Good resources?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    11

    Good resources?

    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.

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    11
    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.

  4. #4
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    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.
    VB Code:
    1. Public Shared Sub main()
    2.         Dim f2 As New Form2
    3.         f2.Show()
    4.         Application.DoEvents()
    5.         System.Threading.Thread.Sleep(5000)
    6.         f2.Close()
    7.         Application.Run(New Form1)
    8.     End Sub

    HTH,
    Mike

  5. #5
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    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.
    VB Code:
    1. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         Dim f2 As New Form2
    3.         f2.Show()
    4.         Application.DoEvents()
    5.         ' Do some lengthy process
    6.         System.Threading.Thread.Sleep(5000)
    7.         f2.Close()
    8.     End Sub

    This of course is using Form1 as the startup object and not sub main.

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2004
    Posts
    11
    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.

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