Basic User Interface Controls of Mobile Internet in VB.NET
n this article I will explain you about Basic User Interface Controls of Mobile Internet in VB.NET.
Here we discuss the basic user
interface (UI) controls of Label, TextBox, and Command-the three most commonly
Label: We saw that the Label class is used for displaying static text on
the screen. You can set the text you want to display through this control's Text
property. The control's syntax looks like the following:
The TextBox control is used to take a single-line input from the user. This
control also has a Text property, in which the input is stored. When you want to
retrieve the input, you use the ID to reference that TextBox and its Text
property. You can restrict input to numeric and masked values by setting the
Numeric or Password properties to true.
You can set a TextBox to take only numeric input.
Or for password input, set the corresponding property to true.
With the Command control you can invoke an event from the user interface. This
will make user input post back to the server and makes use of the Click event.
For a complete picture of what is happening, let's look at an example that uses
these three basic controls (see Listing 24.3).
Listing 24.3: Example Using Basic UI Controls
sender As [Object],
ByVal e As EventArgs)
Label2.Text = "Good Morning"
Me.ActiveForm = Form2
Enter Your Name
Notice that in the Command_OnClick method the ActiveForm property of the
MobilePage class is set to Form2. This is one way to traverse to a specified
form programmatically. When the page is loaded, the first form is automatically
made active, and the Label control asks the user to enter his name. The entered
name is stored in the Text property of TextBox1, and when the user submits the
form clicking on Command Button, the Command function concatenates the static
text and TextBox1 value. The ActiveForm property will make Form2 active, and you
will see another screen displaying the concatenated text.
The output for the two screens is shown in Figures 24.3 and 24.4.
Figure 24.3: Screen Taking Input from User
Figure 24.4: Screen Displaying Output on an OnClick Event
Hope this article would have helped you in understanding Basic User Interface
Controls of Mobile Internet in VB.NET.