My user control (setting properties with my Properties window)
-
I`ve just written my own user control which is inherited from RichTextBox control. This control has it own property called RegularExpression.
private string regularExpression; [Category("Behavior")] [Description("Wyrazenie regularne sprawdzające poprawność danych")] public string RegularExpression { get { return regularExpression; } set { regularExpression = value; } }
With this property I set up the regular expression which validates my data in control. My problem is that I want set up this property by clicking my control`s context menu (a new window form with textBox to set up regular expression in it) like in the picture: Click here... After clicking OK button I want to set up RegularExpression property with context in textBox. In main application in not a problem. The problem apprears when I want do this the way I,ve just described... I can`t create reference:private void okButton_Click(object sender, System.EventArgs e) ValidatingEditControl.KKEditControl.regularExpresson = this.regExpTextBox1.Text; }
It dispays: "ValidatingEditControl.KKEditControl.regularExpresson is inaccesible due to its protectionlevel". Can anyone help me with this? -- modified at 8:21 Monday 20th March, 2006 -
I`ve just written my own user control which is inherited from RichTextBox control. This control has it own property called RegularExpression.
private string regularExpression; [Category("Behavior")] [Description("Wyrazenie regularne sprawdzające poprawność danych")] public string RegularExpression { get { return regularExpression; } set { regularExpression = value; } }
With this property I set up the regular expression which validates my data in control. My problem is that I want set up this property by clicking my control`s context menu (a new window form with textBox to set up regular expression in it) like in the picture: Click here... After clicking OK button I want to set up RegularExpression property with context in textBox. In main application in not a problem. The problem apprears when I want do this the way I,ve just described... I can`t create reference:private void okButton_Click(object sender, System.EventArgs e) ValidatingEditControl.KKEditControl.regularExpresson = this.regExpTextBox1.Text; }
It dispays: "ValidatingEditControl.KKEditControl.regularExpresson is inaccesible due to its protectionlevel". Can anyone help me with this? -- modified at 8:21 Monday 20th March, 2006