Introduction
In this application we used label, textview, button and entry widgets to design
an application.
Working
In this application, when we put any text input into the entry widget and
click on the add button, the given input get displayed in the textview widget.
Designing
Step 1 : Open MonoDevelop.
Step 2 : Create a new solution and rename it.
Step 3 : Go to the designer mode, take a vbox widget and add label ,text
view ,entry and entry widgets to the MainWindow.
Overall Designing as given below.
Program
using
System;
using Gtk;
public
partial class
MainWindow : Gtk.Window
{
public MainWindow()
: base(Gtk.WindowType.Toplevel)
{
Build();
}
protected void
OnDeleteEvent(object sender, DeleteEventArgs a)
{
Application.Quit();
a.RetVal = true;
}
protected void
onbuttonclick(object sender, System.EventArgs e)
{
textview1.Buffer.Text = entry1.Text;
}
}
Output
: To run Press Ctrl+F5
Enter the desired input into the entry widget as show below.
After clicking on the "click to add in TextView
widgets"