G
Guest
I'd like the default text to show up in designer, and allow it to be changed
to something else. I was able to change some of the other properties, but
for some reason I'm having trouble with the text. Here's the code from my
latest attempt. I initially tried just setting this.Text = "E&xit" but that
didn't work. Any ideas?
public class ButtonExit : Button
{
private ToolTip btn_ToolTip;
private System.ComponentModel.IContainer components;
public ButtonExit() : base()
{
this.components = new System.ComponentModel.Container();
this.btn_ToolTip = new ToolTip(this.components);
this.btn_ToolTip.SetToolTip(this, "Use this button to exit the
application.");
this.Enabled = true ;
this.CausesValidation = false;
base.Text = "E&xit";
}
[DefaultValue("E&xit"),
Category("Appearance"),
Description("Default Button Text")]
public override string Text
{
get { return base.Text; }
set
{
base.Text = value;
}
}
}
to something else. I was able to change some of the other properties, but
for some reason I'm having trouble with the text. Here's the code from my
latest attempt. I initially tried just setting this.Text = "E&xit" but that
didn't work. Any ideas?
public class ButtonExit : Button
{
private ToolTip btn_ToolTip;
private System.ComponentModel.IContainer components;
public ButtonExit() : base()
{
this.components = new System.ComponentModel.Container();
this.btn_ToolTip = new ToolTip(this.components);
this.btn_ToolTip.SetToolTip(this, "Use this button to exit the
application.");
this.Enabled = true ;
this.CausesValidation = false;
base.Text = "E&xit";
}
[DefaultValue("E&xit"),
Category("Appearance"),
Description("Default Button Text")]
public override string Text
{
get { return base.Text; }
set
{
base.Text = value;
}
}
}