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. inaccessible due to its protection level ???

inaccessible due to its protection level ???

Scheduled Pinned Locked Moved C#
helpquestion
3 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.
  • R Offline
    R Offline
    Radgar
    wrote on last edited by
    #1

    The error is: 'Class1.frmAccount.txtOwnerName' is inaccessible due to its protection level. public void ShowAddAccount(string Name) { frmAccount frmA = new Class1.frmAccount(); frmA.txtOwnerName.text = Name; // This is the line that causes the error frmA.ShowDialog(); } When I change "private System.Windows.Forms.TextBox txtOwnerName;" to public in frmAccount then it says "'System.Windows.Forms.Control.text' is inaccessible due to its protection level" I know this is a logical mistake but I still need help. Thanks in advance. Radgar "Imagination is more important than knowledge." - Albert Einstein

    C 1 Reply Last reply
    0
    • R Radgar

      The error is: 'Class1.frmAccount.txtOwnerName' is inaccessible due to its protection level. public void ShowAddAccount(string Name) { frmAccount frmA = new Class1.frmAccount(); frmA.txtOwnerName.text = Name; // This is the line that causes the error frmA.ShowDialog(); } When I change "private System.Windows.Forms.TextBox txtOwnerName;" to public in frmAccount then it says "'System.Windows.Forms.Control.text' is inaccessible due to its protection level" I know this is a logical mistake but I still need help. Thanks in advance. Radgar "Imagination is more important than knowledge." - Albert Einstein

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      text with lower case is an internal property. Try Text. Then make it a property. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      R 1 Reply Last reply
      0
      • C Christian Graus

        text with lower case is an internal property. Try Text. Then make it a property. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

        R Offline
        R Offline
        Radgar
        wrote on last edited by
        #3

        Ooops.. Trouble for VB programmers huh? Thanks Christian Radgar "Imagination is more important than knowledge." - Albert Einstein

        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