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. Custom control's property problem

Custom control's property problem

Scheduled Pinned Locked Moved C#
helpquestion
11 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.
  • X Offline
    X Offline
    Xmen Real
    wrote on last edited by
    #1

    i have developed a custom control that have some property to show/hide its child controls. When i set their Visible prop to False the get Hide. But when i run it or just reopen that control they appear again. Any solution ?

    TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

    B P 2 Replies Last reply
    0
    • X Xmen Real

      i have developed a custom control that have some property to show/hide its child controls. When i set their Visible prop to False the get Hide. But when i run it or just reopen that control they appear again. Any solution ?

      TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

      B Offline
      B Offline
      beatles1692
      wrote on last edited by
      #2

      Hi Can you send us some code ?

      X 1 Reply Last reply
      0
      • B beatles1692

        Hi Can you send us some code ?

        X Offline
        X Offline
        Xmen Real
        wrote on last edited by
        #3

        didnt think it would need, well here is it.

        public bool ShowThing
        {
        get { return picturebox1.Visible; }
        set { picturebox1.Visible = value; }
        }

        TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

        1 Reply Last reply
        0
        • X Xmen Real

          i have developed a custom control that have some property to show/hide its child controls. When i set their Visible prop to False the get Hide. But when i run it or just reopen that control they appear again. Any solution ?

          TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

          P Offline
          P Offline
          Pedram Behroozi
          wrote on last edited by
          #4

          Hi, Unfortunately I couldn't get you. What do you mean by Run It? Or Reopen It? When you create a new instance of a Control (User Controls too) its properties got their default values (I hope I could tell it right).

          I died as a mineral and became a plant, I died as plant and rose to animal, I died as animal and I was Man. Why should I fear? When was I less by dying? -- Rumi[^] My blog

          X 1 Reply Last reply
          0
          • P Pedram Behroozi

            Hi, Unfortunately I couldn't get you. What do you mean by Run It? Or Reopen It? When you create a new instance of a Control (User Controls too) its properties got their default values (I hope I could tell it right).

            I died as a mineral and became a plant, I died as plant and rose to animal, I died as animal and I was Man. Why should I fear? When was I less by dying? -- Rumi[^] My blog

            X Offline
            X Offline
            Xmen Real
            wrote on last edited by
            #5

            i know that...'run it' mean run the application

            TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

            P 1 Reply Last reply
            0
            • X Xmen Real

              i know that...'run it' mean run the application

              TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

              P Offline
              P Offline
              Pedram Behroozi
              wrote on last edited by
              #6

              Ummm... So you set the ShowThing value to false but when you run your application they're visible? Maybe you changed some values in PropertyBinding or DataBinding. Make sure their values are set to none. I have a UC like you. It has a property named TextMultiLine, here:

              public partial class LabeledTextBox : UserControl
              {
              public bool TextMultiLine
              {
              get { return txtText.Multiline; }
              set { txtText.Multiline = value; }
              }
              }

              And I have no problem with it:

              public partial class frmMain : Form
              {
              public frmMain()
              {
              InitializeComponent();
              LabeldTextBox ltxt = new LabeledTextBox();

                  ltxt.TextMultiLine = true; // And it works in runtime and everywhere else
              }
              

              }

              I think your problem is in somewhere else. I hope you can find it :)

              I died as a mineral and became a plant, I died as plant and rose to animal, I died as animal and I was Man. Why should I fear? When was I less by dying? -- Rumi[^] My blog

              X 1 Reply Last reply
              0
              • P Pedram Behroozi

                Ummm... So you set the ShowThing value to false but when you run your application they're visible? Maybe you changed some values in PropertyBinding or DataBinding. Make sure their values are set to none. I have a UC like you. It has a property named TextMultiLine, here:

                public partial class LabeledTextBox : UserControl
                {
                public bool TextMultiLine
                {
                get { return txtText.Multiline; }
                set { txtText.Multiline = value; }
                }
                }

                And I have no problem with it:

                public partial class frmMain : Form
                {
                public frmMain()
                {
                InitializeComponent();
                LabeldTextBox ltxt = new LabeledTextBox();

                    ltxt.TextMultiLine = true; // And it works in runtime and everywhere else
                }
                

                }

                I think your problem is in somewhere else. I hope you can find it :)

                I died as a mineral and became a plant, I died as plant and rose to animal, I died as animal and I was Man. Why should I fear? When was I less by dying? -- Rumi[^] My blog

                X Offline
                X Offline
                Xmen Real
                wrote on last edited by
                #7

                dude, its works after InitializeComponent() called but not before. Dunno whats the cause

                TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                L 1 Reply Last reply
                0
                • X Xmen Real

                  dude, its works after InitializeComponent() called but not before. Dunno whats the cause

                  TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Do you by any chance have a private field that looks like this?

                  private bool ShowThing = true;

                  I are troll :)

                  X 1 Reply Last reply
                  0
                  • L Lost User

                    Do you by any chance have a private field that looks like this?

                    private bool ShowThing = true;

                    I are troll :)

                    X Offline
                    X Offline
                    Xmen Real
                    wrote on last edited by
                    #9

                    it wont showup in propertygrid

                    TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                    L 1 Reply Last reply
                    0
                    • X Xmen Real

                      it wont showup in propertygrid

                      TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      [Browsable(true)]
                      public bool TextMultiLine
                      {
                      get { return txtText.Multiline; }
                      set { txtText.Multiline = value; }
                      }

                      This?

                      I are troll :)

                      X 1 Reply Last reply
                      0
                      • L Lost User

                        [Browsable(true)]
                        public bool TextMultiLine
                        {
                        get { return txtText.Multiline; }
                        set { txtText.Multiline = value; }
                        }

                        This?

                        I are troll :)

                        X Offline
                        X Offline
                        Xmen Real
                        wrote on last edited by
                        #11

                        well, i got it work...I just needed to make a bool variable that hold the value and i return its value in property and in set i set both(the visible property and that variable). It worked like charm

                        TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

                        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