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. Password in a Propertygrid

Password in a Propertygrid

Scheduled Pinned Locked Moved C#
question
6 Posts 4 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.
  • A Offline
    A Offline
    Andy Hampshire
    wrote on last edited by
    #1

    Hi All, Probably a stupid qustion ;) but... I've got an object that I'm displaying to the end user via a PropertyGrid control. One of the properties is a Password. I'd like to display this item as "*****" rather than visible text. Is there anyway of doing this ? Cheers .. Andy

    S 1 Reply Last reply
    0
    • A Andy Hampshire

      Hi All, Probably a stupid qustion ;) but... I've got an object that I'm displaying to the end user via a PropertyGrid control. One of the properties is a Password. I'd like to display this item as "*****" rather than visible text. Is there anyway of doing this ? Cheers .. Andy

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      You have to write a custom UI type editor[^]. (there is a sample).


      How low can you go ?
      (MS rant)

      A 1 Reply Last reply
      0
      • S Stephane Rodriguez

        You have to write a custom UI type editor[^]. (there is a sample).


        How low can you go ?
        (MS rant)

        A Offline
        A Offline
        Andy Hampshire
        wrote on last edited by
        #3

        Thanks for the info ... but the link doesn't work for me...

        A 1 Reply Last reply
        0
        • A Andy Hampshire

          Thanks for the info ... but the link doesn't work for me...

          A Offline
          A Offline
          Andy Hampshire
          wrote on last edited by
          #4

          Well i've managed to find the info and i've tried it out. The examples i can find give me the ability to render a UI component as a drop down or modal control. I've played with this and have been able to get a TextBox with a password mask just fine. BUT ... the data in the PropertyGrid is still clear text ! Which is not what i want... this is the text that must be hidden. Ideas anyone ?

          L 1 Reply Last reply
          0
          • A Andy Hampshire

            Well i've managed to find the info and i've tried it out. The examples i can find give me the ability to render a UI component as a drop down or modal control. I've played with this and have been able to get a TextBox with a password mask just fine. BUT ... the data in the PropertyGrid is still clear text ! Which is not what i want... this is the text that must be hidden. Ideas anyone ?

            L Offline
            L Offline
            leppie
            wrote on last edited by
            #5

            I think you need a type convertor , not a UItype editor. Also the password have to be a class of its own (perhaps, maybe not) and not just a string. Hope this helps :) "There are no stupid question's, just stupid people."

            F 1 Reply Last reply
            0
            • L leppie

              I think you need a type convertor , not a UItype editor. Also the password have to be a class of its own (perhaps, maybe not) and not just a string. Hope this helps :) "There are no stupid question's, just stupid people."

              F Offline
              F Offline
              Feng Qin
              wrote on last edited by
              #6

              Well, in the normal way, the property can be edited in a textbox, right? So, we can change its default UITypeEditor to a TextBox which PasswordChar is * or any char you like, by setting some attributes like EditorAttribute on the property you have. Hope helps to you.:cool: I'm amumu, and you?

              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