sharpshell icon indicating copy to clipboard operation
sharpshell copied to clipboard

Deskband transparency issue

Open antti202 opened this issue 5 years ago • 6 comments

Version of SharpShell used: 2.7.1 ... How to get transparency working? I set BackColor: Transparent but it isn't working.

antti202 avatar May 19 '19 16:05 antti202

Hey there,

sorry no one answered yet. I'm gonna try to help you.

What do you want to make transparent? Any details? Maybe a picture? What color does it show when you set it to transparent? What OS do you use Windows 10?

Countryen avatar May 30 '19 20:05 Countryen

I also have this problem. Here is my code (win10 1803):

// BandService
protected override BandOptions GetBandOptions() {
    return new BandOptions {
        HasVariableHeight = false,
        IsSunken = false,
        ShowTitle = true,
        Title = "CPU Mem",
        UseBackgroundColour = false,
        AlwaysShowGripper = true
    };
}

// UI
this.BackColor = System.Drawing.Color.Transparent;
this.Controls.Add(this.label_Mem);
this.Controls.Add(this.label_CPU);
this.label_Mem.BackColor = System.Drawing.Color.Transparent;
this.label_CPU.BackColor = System.Drawing.Color.Transparent;
// ...

image

Aoi-hosizora avatar Aug 06 '19 13:08 Aoi-hosizora

@antti202 I just have seen that if I set the UserControl's background to black and set the UseBackgroundColour BandOptions to false, it will work well!

image

But there is another problem. I use StartIsBack which is used to change the windows taskbar theme, and the transparent will have a wrong priority.

image image

Aoi-hosizora avatar Aug 06 '19 16:08 Aoi-hosizora

Hi @Countryen - I've also experienced this bug. I'm using Windows 10 and SharpShell v2.7.2.

I was able to work around it using instructions that @Aoi-hosizora gave: set BackColor to Black and set UseBackgroundColour to false.

This is confusing behaviour. I expect that either a) setting UseBackgroundColour and setting BackColor to Transparent or b) not setting UseBackgroundColour would set the background of the UserControls to be transparent.

I used the code that you end up with at the end of the DeskBand tutorial to generate this.

Let me know if you need any more information or screenshots - I'm happy to help out.

apuchitnis avatar Apr 14 '21 14:04 apuchitnis

Hey @apuchitnis, thanks for asking but I am not the author and never had this issue, I was just asking for more information to help out :) So either you meant to ask the author of the issue or you could close this, if this works. Or what do you mean? Sorry I've been very inactive for a while.

Countryen avatar Apr 14 '21 20:04 Countryen

Hey @Countryen - sorry, perhaps I wasn't clear enough. To confirm - am I right in understanding that you're a maintainer of this project?

My intention was to continue the original author's thread and add more information about this bug, so that we can find a proper fix rather than a workaround.

apuchitnis avatar Apr 14 '21 20:04 apuchitnis