At least in my version of gtk# the text in the entry is initially selected so when the user starts typing it is automatically deleted. If that's not enough for you, you can for example use the FocusInEvent
to clear the text, optionally re-installing it on FocusOutEvent
if the user hasn't entered anything.
public class FancyEntry : Entry
{
private string _message;
public FancyEntry(string message) : base(message)
{
_message = message;
FocusInEvent += OnFocusIn;
FocusOutEvent += OnFocusOut;
}
private void OnFocusIn(object sender, EventArgs args)
{
FocusInEvent -= OnFocusIn;
this.Text = String.Empty;
}
private void OnFocusOut(object sender, EventArgs args)
{
if (String.IsNullOrEmpty(this.Text))
{
this.Text = _message;
FocusInEvent += OnFocusIn;
}
}
}