MainClass.Text Property

Our sample property.
Public Property Text() As String
This language is not supported or no code example is available.
public string Text {get; set;}
This language is not supported or no code example is available.
member Text : string with get, set
This language is not supported or no code example is available.
public:  
property String^ Text { 
String^ get( ); 
void set( 
String^ value 
); 
}
This language is not supported or no code example is available.
public function get Text() : String
public function set Text(value : String);
This language is not supported or no code example is available.

Property Value

string

Some nice text.

Remarks
 
This property is really interesting. We can use:
  1. font formatting or code
  2. bulleted or numbered lists
  3. tables, pictures, links

Here is a table:

Column1Column2
abc123
def456
Example
 
This is an example how to use Text and SelectedValue properties:
try {
   if (this.Text != "hello") {
     return SelectedValue;
   }
 } catch (nestedException ex) {
   return SampleEnum.value1;
 }					
This language is not supported or no code example is available.
Try
      If Me.Text <> "hello" Then
          Return SelectedValue
      End If
 Catch ex As nestedException
      Return SampleEnum.value1
 End Try					
This language is not supported or no code example is available.
Author
 
Peter Macej
Version
 
3.0
29
public string Text
 {
     get { return _Text; }
     set
     {
         if (value != _Text)
         {
             string oldVal = _Text;
             _Text = value;
             if (TextChanged != null)
             {
                 TextChanged(this, new TextChangedEventArgs(oldVal, value));
             }
         }
     }
 }
					
This language is not supported or no code example is available.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Core

Supported in: 1.0, 1.1, 2.0

.NET Standard

Supported in: 2.0

Xamarin.Android

Supported in: 7.1

Portable Class Library

Supported in: Portable Class Library

In this article

Definition