» Home
» Tutorials
» Search  
» Contact us 

Home » Tutorials » Introduction to Visual Basic .NET » Chapter 6

Chapter 6: Building Windows Applications
6.2: Building a Simple Application
6.2.4: Creating the Show Me! Button Code

Creating the Show Me! Button Code

To finish this exercise, you need to write code for the Show Me! button. All you’re going to do with this button is display a message box containing the same text that’s displayed on lblResults.

 

Exercise - Coding the Show Me! Button

1. In the Code Editor, select btnShowMe from the Class Name combo box and then select the Click event in the Method Name combo box. Then add the highlighted code:

Private Sub btnShowMe_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles btnShowMe.Click
‘Display the text contained in the Label control
MessageBox.Show(lblResults.Text, “Word Counter”)
End Sub

2. Run the project and type something into the text box. Then click the Show Me! button, and the same value will be displayed in the message box appears in the results Label control.

 

click next Page - How It Works.

Home | Link to Us | Partner Links | About us | Contact us

Copyright © 2009-2012 F1tutorials.com | All Rights Reserved