locked
hello world VB sample in VS2013 for WP8.1 RRS feed

  • Question

  • I'm new to Windows Phone programming and trying to start with a simple hello world app.

    I completely understand now  why Windows Phone is not taking off at all.

    I have a button and can change a textbox after hitting it but I want a simple messagebox.

    I spend hours finding a simple way to do this. No success.

    Using the newest visual studio 2013 on Windows 8.1. Even downloaded the last .net framework which probably was unnecessarry.

    1/ Why is there no simple example in VS2013? Why can't I find it?

    2/ Messagebox is supported by namespace system.windows but it appears to be twice in the object browser and it appears that messagebox falls under the oldest namespace. The newest one only shows "input" after the dot and NO messagebox. Maybe there should be a way to UNreference the newest namespace until Microsoft fixes the new one??

    3/ Messagedialog is a more complex alternative which proved to work but wow this got complex? You have to use a new instance and showasync?? Simplicity hello where are you?

    What am I doing wrong? Anyone can help me on 1 of my 3 questions?

    Thursday, May 8, 2014 7:46 PM

All replies

  • 3/ You want have "messageBox" then you must added "Private Async void " and into it is :

    dialog = new MessageDialog("Where are you?");
    await dialog.ShowAsync();

    Simple messagebox is not.

    1/ About simple example is difficult to find.

    Sunday, May 18, 2014 3:16 PM
  • 2/ I think writen as which:

    Private Async void button(....){
    
    
    
    dialog = new MessageDialog(txthello.text);
    await dialog.ShowAsync();
    
    
    }
    

    Sunday, May 18, 2014 3:19 PM
  • sr, i using C# but VB have same it.
    Sunday, May 18, 2014 3:20 PM
  • See How to create your first app for Windows Phone for introductory tutorials for Windows Phone Runtime apps.

    You can set the object browser to "My Solution" and it will show only classes available in your solution. Modal dialogs such as MessageBoxes are not generally recommended for use. In most cases it is much friendlier to your users to include the message in context on the page.

    MessageBox is not used in Windows Runtime apps. As you note, the MessageDialog is similar. Again though, it isn't something you want to use often. In most cases when you are tempted to use a MessageDialog you should look carefully to decide if it's really the best UI or if there is a way to pass the information without blocking the user or pulling the user out of context.

    --Rob

    Sunday, May 18, 2014 6:50 PM