Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems with calling context menu #37

Open
xmoer opened this issue Jan 9, 2019 · 10 comments
Open

Some problems with calling context menu #37

xmoer opened this issue Jan 9, 2019 · 10 comments
Labels

Comments

@xmoer
Copy link

xmoer commented Jan 9, 2019

Thank the author for making this project, but I found some small problems in use.

  1. Right-click on taskbar tool image is invalid. Context menu can only be displayed by right-clicking in the blank or penetrated area.
  2. In the white taskbar of Windows10 (19H1), CSDeskBand.Wpf tools will have black jagged edges.
@dsafa
Copy link
Owner

dsafa commented Jan 17, 2019

For 1. is it with winforms or wpf? do you have an example screenshot or video.
For 2. I'll take a look when the update comes out. wpf doesn't combine too well with the taskbar so there will probably be issues.
Thanks.

@dsafa dsafa added the bug label Jan 17, 2019
@xmoer
Copy link
Author

xmoer commented Jan 17, 2019

Both problems arise on wpf. Question 1 is somewhat indescribable, so I drew a demo graphics.

view

This is a taskbar demo. Wpf was used to draw the blue graphics. Right-click on blue graphics is invalid, context menu can only be displayed by right-clicking in the black area. If the blue graphics is replaced by an image control, the result is the same.

@dsafa
Copy link
Owner

dsafa commented Jan 22, 2019

Thanks for the visual. I believe its because wpf is not bubbling the event up to winforms. I'll see what I can do with that.

@dsafa
Copy link
Owner

dsafa commented Mar 7, 2019

I found that its because the form doesn't pass the click even through to the taskbar. I have a fix for non transparent wpf controls but for transparency i'm not currently sure on how to fix it.

@xmoer
Copy link
Author

xmoer commented Mar 7, 2019

Yes, it's not easy to solve these two problems. I'm also studying how to fix the second problem (edge jagged for non-black background).

@xmoer
Copy link
Author

xmoer commented May 2, 2019

I found a few strange problems. Control edges have color residues because TranparencyKey & BackColor is imperfect. But transparent methods do not show the same effect in various versions of Windows10.

The background of the system taskbar before 19H1 is black by default, so you won't see black serrated teeth. Now Microsoft has added the light mode, and the taskbar and start menu background can turn white. The problem of edge color residue became serious and I tried many methods.

First, I changed the transparent color to magenta or white, and the result was still terrible. Then I quoted the project: https://github.com/patbec/TaskbarSampleExtension. I modified the file to try to load the WPF control directly.

[File: TaskbarSampleExt/DeskBand.cs]
public class DeskBand : UserControl, IObjectWithSite, IDeskBand2 { …… }
[After editing: ]
public class DeskBand : ElementHost, IObjectWithSite, IDeskBand2 { …… }

Without specifying the transparent color, only "BackColorTransparent = true" is needed to achieve the perfect display effect. Of course, this method only works under 19H1, and will turn into a black background in the old system. The result surprised me.

This may be related to Microsoft's continuous improvement of the system kernel? Multiple strategies may be needed to solve the problem of perfect background transparency.

@dsafa
Copy link
Owner

dsafa commented May 3, 2019

Thanks for the news. This is really interesting. I guess we'll just have to rely on microsoft's changes.

@dsafa
Copy link
Owner

dsafa commented May 9, 2019

In version 3.1 I updated so transparency works properly. Context menu is still a bit of an issue though

@xmoer
Copy link
Author

xmoer commented May 11, 2019

ContextMenu may not be a problem? Although it's not perfect, we can customize a menu. For example:

<Grid>
    <Grid.ContextMenu>
        <ContextMenu>
            <MenuItem Name="MenuItem1" Header="AAAAA"/>
            <MenuItem Name="MenuItem2" Header="BBBBB"/>
        </ContextMenu>
    </Grid.ContextMenu>
    ……
</Grid>

@dsafa
Copy link
Owner

dsafa commented May 11, 2019

Yeah, creating your own context menu is what I would recommend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants