Click here to Skip to main content
15,894,630 members
Articles / Programming Languages / Visual Basic

Build Mobile PC Awareness lnto Mobile PC agnostic Windows Forms apps using Inheritance.

Rate me:
Please Sign up or sign in to vote.
4.19/5 (8 votes)
18 May 2007CPOL6 min read 35K   714   17  
Easily incorporate ink, power, network and size awareness into a Windows Form Application. The "Black Jack Card Game Starter Kit" is used as an example of a Mobile PC unaware app that is converted into a Mobile PC app by inheriting from the MobilePCAwareForm included with the download.
Public Class StartForm

    ''' <summary>
    ''' Invokes a new BlackJack game
    ''' </summary>
    Private Sub NewGameBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles newGameButton.Click
        ' Show the main BlackJack UI game
        Using blackjackform As New BlackJackForm
            Hide()
            blackjackform.ShowDialog()
            Show()
        End Using
    End Sub

    ''' <summary>
    ''' Brings up the options form
    ''' </summary>
    Private Sub OptionsBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles optionsButton.Click
        'Show the Options panel
        Using optionsForm As New OptionsForm
            Hide()
            optionsForm.ShowDialog()
            Show()
        End Using
    End Sub

    ''' <summary>
    ''' Exits the application
    ''' </summary>
    Private Sub ExitBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitButton.Click
        'Exit the Game
        Application.Exit()
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions