- Working with Base Types
- Collections and Data Structures
- Generics in the .NET Framework
- Handling and Raising Events
- Handling and Throwing Exceptions
- File and Stream I/O
- Dates, Times, and Time Zones
- Programming with Application Domains and Assemblies
- Serialization [from BPUEDev11]
- Resources in Desktop Apps
- Globalizing and Localizing .NET Framework Applications
- Accessibility
- Extending Metadata Using Attributes
- 64-bit Applications
.NET Framework Application Essentials
Labels:
.Net Framework,
.Net Framework and Tools
Override ToString Method in VB.Net
This is a Example for Override ToString Method in VB.Net
Public Class Class1
Public idx As Integer
Public Overrides Function ToString() As String
Return Me.idx.ToString() + " " + "VB.Net"
End Function
End Class
Paste this following code in your main form Public idx As Integer
Public Overrides Function ToString() As String
Return Me.idx.ToString() + " " + "VB.Net"
End Function
End Class
Dim cl As Class1 = New Class1
cl.idx = 100
MessageBox.Show(cl.ToString())
Result:cl.idx = 100
MessageBox.Show(cl.ToString())
100 VB.Net
Labels:
VB.Net
Override ToString Method in C#.Net
This is a Example for Override ToString Method in C#.Net
To Create a Class File for Convert a integer into string
To Create a Class File for Convert a integer into string
private int idx;
public Class1(int idxs)
{
this.idx = idxs;
}
public Class1(int idxs)
{
this.idx = idxs;
}
public override string ToString()
{
return this.idx.ToString() + " " + "Good";
}
Paste this following code in your main form{
return this.idx.ToString() + " " + "Good";
}
Class1 cls = new Class1(10);
MessageBox.Show(cls.ToString());
Output:
MessageBox.Show(cls.ToString());
Output:
10 Good
Labels:
C#.Net