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. How can I prevent my control to be serialized in design-mode?

How can I prevent my control to be serialized in design-mode?

Scheduled Pinned Locked Moved C#
questiondesign
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.
  • T Tesic Goran

    Hello, How can I prevent my control to be serialized in design-mode? Thank you in advance. Goran

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

    Need more info.

    T 1 Reply Last reply
    0
    • D Daniel1324

      Need more info.

      T Offline
      T Offline
      Tesic Goran
      wrote on last edited by
      #3

      So, when I move the control in design-mode I would like the position settings not to be updated.

      D D 2 Replies Last reply
      0
      • T Tesic Goran

        So, when I move the control in design-mode I would like the position settings not to be updated.

        D Offline
        D Offline
        Daniel1324
        wrote on last edited by
        #4

        You're serializing a control? I didnt even think that you could serialize a control.

        T 1 Reply Last reply
        0
        • T Tesic Goran

          So, when I move the control in design-mode I would like the position settings not to be updated.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #5

          Ummm....What??? If you move the control, you're changing the position! When you move the control in the designer, the only property of the control being changed is Location. So how do you want to both move and not move the control? What are you really trying to do with this? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          T 1 Reply Last reply
          0
          • D Daniel1324

            You're serializing a control? I didnt even think that you could serialize a control.

            T Offline
            T Offline
            Tesic Goran
            wrote on last edited by
            #6

            Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?

            D L 2 Replies Last reply
            0
            • T Tesic Goran

              Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?

              D Offline
              D Offline
              Daniel1324
              wrote on last edited by
              #7

              Do you mean that you want to check to see if youre running in debug or release mode?

              T 1 Reply Last reply
              0
              • D Daniel1324

                Do you mean that you want to check to see if youre running in debug or release mode?

                T Offline
                T Offline
                Tesic Goran
                wrote on last edited by
                #8

                No. The control can be placed to the form in design mode in MSVS.NET IDE - design-mode or the application can be run - run-mode.

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Ummm....What??? If you move the control, you're changing the position! When you move the control in the designer, the only property of the control being changed is Location. So how do you want to both move and not move the control? What are you really trying to do with this? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                  T Offline
                  T Offline
                  Tesic Goran
                  wrote on last edited by
                  #9

                  Actually, I would like to check in the constructor of my control where I am - in design-mode in MSVS.NET IDE or in runtime, which means my application is started. How can I check that?

                  D 1 Reply Last reply
                  0
                  • T Tesic Goran

                    Actually, I would like to check in the constructor of my control where I am - in design-mode in MSVS.NET IDE or in runtime, which means my application is started. How can I check that?

                    D Offline
                    D Offline
                    Dave Kreskowiak
                    wrote on last edited by
                    #10

                    Just check the DesignMode property. It'll be true if you're in DesignMode and false if in Runtime or other. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                    1 Reply Last reply
                    0
                    • T Tesic Goran

                      Actually, I would like to check in the constructor of my control where I am - in designer or in runtime. How can i do that?

                      L Offline
                      L Offline
                      lmoelleb
                      wrote on last edited by
                      #11

                      Try this: if (DesignMode) { }

                      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