Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. My user control (setting properties with my Properties window)

My user control (setting properties with my Properties window)

Scheduled Pinned Locked Moved C#
helpregexquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    conrado7
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • C conrado7

      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

      D Offline
      D Offline
      darkelv
      wrote on last edited by
      #2

      regularExpression is private. Use 'RegularExpression' which is public.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups