Using form elements

For sure, you will need most of the form elements that Xamarin Studio provides. Form elements will give you a very easy and quick way to get a request and retrieve data from users—as we have done several times with the TextView elements.

Getting ready

Create a new Android project named GUIForm.

How to do it...

  1. CheckBox:

    A checkbox is either checked or not, and it contains an associated label describing the choice that the user is about to make:

    CheckBox cb = FindViewById<CheckBox> (Resource.Id.checkBox1); 
  2. Obviously, checkboxes support the method in order to know whether it's checked or not and to change the associated text. Respectively, these methods are as follows:
    cb.Text = "My Describing Text"; Boolean isMyCheckBoxChecked = cb.Checked; ...

Get Xamarin Studio for Android Programming: A C# Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.