W
Wan Andii
Hello Group,
I have a simple derived class 'TextBoxTestMsg' from textbox class. So
far I was able to inherit textbox to 'TextBoxTestMsg' with a public
property 'EnableMsg'. When the 'EnableMsg' is set to true then the
ontextchange event will be called. When I add 'TextBoxTestMsg' to a
form and set the 'EnableMsg' to true it doesn't change text value to
"Add text...".
How can I set the text value on load if EnableMsg is true? and also
I'd like to save the EnableMsg value the next time I load the project.
Regards,
Wan
------------------------------------
class TextBoxTestMsg: TextBox
{
public Boolean enableMsg = false;
public Boolean EnableMsg
{get/set...}
public TextBoxTestMsg()
{
if (EnableMsg == false) return;
Text = "Add text here...";
}
protected override void OnTextChanged(EventArgs e)
{
if (EnableMsg == false) return;
base.OnTextChanged(e);
MessageBox.Show("text msg");
}
}
------------------------------------
I have a simple derived class 'TextBoxTestMsg' from textbox class. So
far I was able to inherit textbox to 'TextBoxTestMsg' with a public
property 'EnableMsg'. When the 'EnableMsg' is set to true then the
ontextchange event will be called. When I add 'TextBoxTestMsg' to a
form and set the 'EnableMsg' to true it doesn't change text value to
"Add text...".
How can I set the text value on load if EnableMsg is true? and also
I'd like to save the EnableMsg value the next time I load the project.
Regards,
Wan
------------------------------------
class TextBoxTestMsg: TextBox
{
public Boolean enableMsg = false;
public Boolean EnableMsg
{get/set...}
public TextBoxTestMsg()
{
if (EnableMsg == false) return;
Text = "Add text here...";
}
protected override void OnTextChanged(EventArgs e)
{
if (EnableMsg == false) return;
base.OnTextChanged(e);
MessageBox.Show("text msg");
}
}
------------------------------------