public partial class textbox1 : System.Windows.Forms.TextBox
{
private void FindConterHelppr()
{
string formname = this.FindForm().Name;
string nam = this.GetType().Namespace; string aa = "Form2" + SetHelpTextBoxKeys;
System.Windows.Forms.HelpProvider h = null;
if (h == null)
h = new System.Windows.Forms.HelpProvider();
h.SetHelpString(this, aa);
}
[Category("HelpTextBoxKeys"), Description("HelpTextBox")]
public string SetHelpTextBoxKeys
{
set
{
value = this.Name;
if (value.Length != 0)
{
sethelptextboxkeys = value;
FindConterHelppr();
}
}
get { return sethelptextboxkeys; } }
}
{
private void FindConterHelppr()
{
string formname = this.FindForm().Name;
string nam = this.GetType().Namespace; string aa = "Form2" + SetHelpTextBoxKeys;
System.Windows.Forms.HelpProvider h = null;
if (h == null)
h = new System.Windows.Forms.HelpProvider();
h.SetHelpString(this, aa);
}
[Category("HelpTextBoxKeys"), Description("HelpTextBox")]
public string SetHelpTextBoxKeys
{
set
{
value = this.Name;
if (value.Length != 0)
{
sethelptextboxkeys = value;
FindConterHelppr();
}
}
get { return sethelptextboxkeys; } }
}
怎么实现的?
你这里都是null了。后面还有什么意义呢~
if(this.FindForm()!=null ){
formname = this.FindForm().Name;
}
The Form that the control is on. 或许你的控件和当前FORM没有包含关系。
可以直接把FORM的名字存下来,STRING传过来用啊。