MessageDialogs [Metro Apps]

Visual Basic tutorials for UWP apps.
1 post Page 1 of 1
Contributors
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

MessageDialogs [Metro Apps]
smashapps
Hello,

This is a very easy tutorial but it's for a metro app so it's cool, lol. We're creating a MessageDialog like shown below:

Image

To show our Message we're going to call it when we click on a button. To create a button drag the button control from the Toolbox to page. You need to give the button a name, I am calling mine btnHello
If you want to change the text of the button browse for the "Content" property in the properties pane on the right of the screen.

Double click on the button you've create to create the click event sub statement and then add this code:
Code: Select all
 Dim msg As New Windows.UI.Popups.MessageDialog("Hello CodenStuff! I am a MessageDialog!")
 Await msg.ShowAsync()
The first line we're declaring msg as a new MessageDialog and settings it's value and the second line we're showing it. Because we're using Await we need to change the sub statement to Private Async Sub instead of Private Sub

If you don't do this the error message you're given will have the option to change that for you.
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
1 post Page 1 of 1
Return to “Visual Basic”