VB.net 2005 splash screen

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • steve

    #1

    VB.net 2005 splash screen

    Hi All

    I have set a splash screen form as the application splash screen in VB.net
    2005

    I t runs fine but stays on top when my login screen appears

    How can I shut the splash screen down when the login screen is shown

    Attempts to close it from the application main form results in error message

    e.g frmsplash.close

    'Cross thread operation not valid'

    Any ideas

    Regards
    Steve


  • Walter Wang [MSFT]

    #2
    RE: VB.net 2005 splash screen


    Hi Steve,

    Thank you for your post.

    Based on my understanding, you're using a background thread to show the
    splash form, and tring to close it when the login form shows. If I've
    misunderstood anything, please feel free to post here.

    Windows Forms uses the single-threaded apartment (STA) model because
    Windows Forms is based on native Win32 windows that are inherently
    apartment-threaded. The STA model implies that a window can be created on
    any thread, but it cannot switch threads once created, and all function
    calls to it must occur on its creation thread.

    The STA model requires that any methods on a control that need to be called
    from outside the control's creation thread must be marshaled to (executed
    on) the control's creation thread. The base class Control provides several
    methods (Invoke, BeginInvoke, and EndInvoke) for this purpose. Invoke makes
    synchronous method calls; BeginInvoke makes asynchronous method calls.

    So for your question, the splash form can be closed using following code:

    frmsplash.Invok e(new MethodInvoker(A ddressOf frmsplash.Close ))

    Also, Visual Basic 2005 has builtin support for splash form. Please refer
    to following msdn documentation:

    #My.Application .SplashScreen
    http://msdn2.microsoft.com/en-us/1t310742.aspx

    Hope this helps. Please feel free to post here if anything is unclear.

    Regards,
    Walter Wang
    Microsoft Online Community Support

    =============== =============== =============== =====
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    =============== =============== =============== =====

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • steve

      #3
      Re: VB.net 2005 splash screen

      Hi Walter

      I don't know how much they pay you but it isn't enough

      Thanks heaps

      Regards
      Steve

      "Walter Wang [MSFT]" <wawang@online. microsoft.com> wrote in message
      news:KbnoZLGkGH A.4528@TK2MSFTN GXA01.phx.gbl.. .[color=blue]
      >
      > Hi Steve,
      >
      > Thank you for your post.
      >
      > Based on my understanding, you're using a background thread to show the
      > splash form, and tring to close it when the login form shows. If I've
      > misunderstood anything, please feel free to post here.
      >
      > Windows Forms uses the single-threaded apartment (STA) model because
      > Windows Forms is based on native Win32 windows that are inherently
      > apartment-threaded. The STA model implies that a window can be created on
      > any thread, but it cannot switch threads once created, and all function
      > calls to it must occur on its creation thread.
      >
      > The STA model requires that any methods on a control that need to be
      > called
      > from outside the control's creation thread must be marshaled to (executed
      > on) the control's creation thread. The base class Control provides several
      > methods (Invoke, BeginInvoke, and EndInvoke) for this purpose. Invoke
      > makes
      > synchronous method calls; BeginInvoke makes asynchronous method calls.
      >
      > So for your question, the splash form can be closed using following code:
      >
      > frmsplash.Invok e(new MethodInvoker(A ddressOf frmsplash.Close ))
      >
      > Also, Visual Basic 2005 has builtin support for splash form. Please refer
      > to following msdn documentation:
      >
      > #My.Application .SplashScreen
      > http://msdn2.microsoft.com/en-us/1t310742.aspx
      >
      > Hope this helps. Please feel free to post here if anything is unclear.
      >
      > Regards,
      > Walter Wang
      > Microsoft Online Community Support
      >
      > =============== =============== =============== =====
      > When responding to posts, please "Reply to Group" via your newsreader so
      > that others may learn and benefit from your issue.
      > =============== =============== =============== =====
      >
      > This posting is provided "AS IS" with no warranties, and confers no
      > rights.
      >[/color]


      Comment

      • Walter Wang [MSFT]

        #4
        Re: VB.net 2005 splash screen

        Hi Steve,

        Thank you. It is always our pleasure to be of assistance.

        Have a nice day!

        Regards,
        Walter Wang
        Microsoft Online Community Support

        =============== =============== =============== =====
        When responding to posts, please "Reply to Group" via your newsreader so
        that others may learn and benefit from your issue.
        =============== =============== =============== =====

        This posting is provided "AS IS" with no warranties, and confers no rights.

        Comment

        Working...