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 be a Transparent panel control can be created

How can be a Transparent panel control can be created

Scheduled Pinned Locked Moved C#
winforms
3 Posts 3 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.
  • S Offline
    S Offline
    Shashidharreddy
    wrote on last edited by
    #1

    How can be a transparent panel control can be created. As I tried in many ways but it is applicable to window but not to the required control (panel), as well as I also have observed that Transparency will be applicable to windows forms but not to user control. Is it so, if yes why. Shashidhar

    A E 2 Replies Last reply
    0
    • S Shashidharreddy

      How can be a transparent panel control can be created. As I tried in many ways but it is applicable to window but not to the required control (panel), as well as I also have observed that Transparency will be applicable to windows forms but not to user control. Is it so, if yes why. Shashidhar

      A Offline
      A Offline
      AB7771
      wrote on last edited by
      #2

      i have tried a lot but did not find any method for that i think it's impossible Regards, Pramod

      1 Reply Last reply
      0
      • S Shashidharreddy

        How can be a transparent panel control can be created. As I tried in many ways but it is applicable to window but not to the required control (panel), as well as I also have observed that Transparency will be applicable to windows forms but not to user control. Is it so, if yes why. Shashidhar

        E Offline
        E Offline
        exhaulted
        wrote on last edited by
        #3

        Try making a bitmap that is all one colour and setting it as the background image for your panel. Then add the following code to the form_Load event

        Bitmap bitmap = (Bitmap)pnlBackground.BackgroundImage;
        bitmap.MakeTransparent(bitmap.GetPixel(1, 1));
        TransparencyKey = BackColor;

        You may also need to start the form minimized and then do WindowState = FormWindowState.Normal; I don't know why but sometimes this is the case. Cheers Kev

        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