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. GDI and User Control related

GDI and User Control related

Scheduled Pinned Locked Moved C#
questiongraphicsdesign
4 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.
  • F Offline
    F Offline
    fjlv2005
    wrote on last edited by
    #1

    Good day, I have a user control. My user control is customize Panel which can be minimize or maximize. I use Transparent as background of my control. I tried to test my new control under a form that has a background picture. When I run my test program, i've tried to minimize my user control Panel but the area that was left behind by my panel is NOT the background image picture of the form where i put my user control instead the trasparent color appear. Is there a way that we could get the background of the Area what was overlapped by my user control ? How can I make my user control aware of the background area that it overlapped at design time so that I could restore that area when my control is minimize? Any suggestions would be appreciated. Thanks,

    S 1 Reply Last reply
    0
    • F fjlv2005

      Good day, I have a user control. My user control is customize Panel which can be minimize or maximize. I use Transparent as background of my control. I tried to test my new control under a form that has a background picture. When I run my test program, i've tried to minimize my user control Panel but the area that was left behind by my panel is NOT the background image picture of the form where i put my user control instead the trasparent color appear. Is there a way that we could get the background of the Area what was overlapped by my user control ? How can I make my user control aware of the background area that it overlapped at design time so that I could restore that area when my control is minimize? Any suggestions would be appreciated. Thanks,

      S Offline
      S Offline
      Snews
      wrote on last edited by
      #2

      The simplest thing to do is to invalidate or refresh the form when the customize Panel is minimized/maximized. You can let the customize Panel trigger a minimized/maximized event back to the parent control or just use the 'this.Parent.Refresh()' but that's not a very neet way of handling the problem. Another way of solving the problem is to calculate the area that should be invalidated and then repaint only that small area. I hope that might give you some idé to solve the problem. :)

      F 1 Reply Last reply
      0
      • S Snews

        The simplest thing to do is to invalidate or refresh the form when the customize Panel is minimized/maximized. You can let the customize Panel trigger a minimized/maximized event back to the parent control or just use the 'this.Parent.Refresh()' but that's not a very neet way of handling the problem. Another way of solving the problem is to calculate the area that should be invalidated and then repaint only that small area. I hope that might give you some idé to solve the problem. :)

        F Offline
        F Offline
        fjlv2005
        wrote on last edited by
        #3

        Hi SNews Thanks for your feedback, however, I already tried to add a handler to my panel. so that in the forms code : mypanel.SetParentControl(myparentcontrolorparentform); and on my panel code: private Control m_parentcontrol=null; public void SetParentControl(Control e) { m_parentcontrol=e; } [Browsable(true)] [TypeConverter(typeof(boolValueConverter))] [DisplayName("Collapse"), Category("Panel Information"), Description("Minimize/Maximize Panel")] public bool Collapse { get { return m_isminimized; } set { m_isminimized = value; if(m_parent!=null) m_parentcontrol.Refresh(); Refresh(); } } However the when my panel is minimized, the area that was left behind displays the transparent color. If its okay with you, can i ask for your email address so that I could email you the output sample of my program. Perhaps I'll to follow your second suggestion, however how can my user control aware or get the area only that it has overlapped? Thanks

        S 1 Reply Last reply
        0
        • F fjlv2005

          Hi SNews Thanks for your feedback, however, I already tried to add a handler to my panel. so that in the forms code : mypanel.SetParentControl(myparentcontrolorparentform); and on my panel code: private Control m_parentcontrol=null; public void SetParentControl(Control e) { m_parentcontrol=e; } [Browsable(true)] [TypeConverter(typeof(boolValueConverter))] [DisplayName("Collapse"), Category("Panel Information"), Description("Minimize/Maximize Panel")] public bool Collapse { get { return m_isminimized; } set { m_isminimized = value; if(m_parent!=null) m_parentcontrol.Refresh(); Refresh(); } } However the when my panel is minimized, the area that was left behind displays the transparent color. If its okay with you, can i ask for your email address so that I could email you the output sample of my program. Perhaps I'll to follow your second suggestion, however how can my user control aware or get the area only that it has overlapped? Thanks

          S Offline
          S Offline
          Snews
          wrote on last edited by
          #4

          Yes, send me an email through the message board and I will reply to that so you get my email adress.:)

          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