Git Product home page Git Product logo

Comments (14)

voidZiAD avatar voidZiAD commented on July 19, 2024

Unfortunately, the blur effect works ONLY on WindowTypes other than "None". There could be a fix, I am currently seeing what I can improve in this project or fix. But, it's likely that this is something that cannot be fixed and it's a feature by Windows, where only default WindowType/Style is going to be blurred.

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

Btw, by WindowTypes/Style I meant FormBorderStyle. My bad.

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

Here's a temporary fix!

(This should be in your form btw)

protected override CreateParams CreateParams
{
    get
    {
        int WS_DLGFRAME = 0x400000;
        CreateParams result = base.CreateParams;
        result.Style &= ~WS_DLGFRAME;
        return result;
    }
}

This should allow you to use the Effect while not seeing the default border/title and implementing your own border and top bar. Btw, the FormBorderStyle should not be None, so technically this isn't a fix, but it works. I will still be looking into a way to fix this.

from winblur.

xVotexX avatar xVotexX commented on July 19, 2024

Thanks for your reply! I have now set my FormBorderStyle to Sizeable but I don't quite understand where exactly I should put your fix. Can you please give me a full code example as in my original message?

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

Here's a code example:

using System;
using System.Windows.Forms;
using WinBlur;

namespace WinBlurTest
{
    public partial class Form1 : Form
    {

        protected override CreateParams CreateParams
        {
            get
            {
                int WS_DLGFRAME = 0x400000;
                CreateParams result = base.CreateParams;
                result.Style &= ~WS_DLGFRAME;
                return result;
            }
        }

        public Form1()
        {
            InitializeComponent();
            UI.SetBlurStyle(cntrl: this, blurType: UI.BlurType.Acrylic, designMode: UI.Mode.DarkMode);
        }
        
        private void Form1_Load(object sender, EventArgs e)
        {


        }
    }
}

It should be at the top of the class

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

Let me know if it works. I noticed that it doesn't ALWAYS work, but let me know. it should look like this:
Screenshot (1)

from winblur.

xVotexX avatar xVotexX commented on July 19, 2024

In my case, the form is just black. In the Designer i set the BackColor to Standart Control

using System;
using System.Drawing;
using System.Windows.Forms;
using WinBlur;
using static WinBlur.UI;

namespace WindowsFormsApp2
{
    public partial class Popup : Form
    {

        protected override CreateParams CreateParams
        {
            get
            {
                int WS_DLGFRAME = 0x400000;
                CreateParams result = base.CreateParams;
                result.Style &= ~WS_DLGFRAME;
                return result;
            }
        }

        public Popup()
        {
            InitializeComponent();
            UI.SetBlurStyle(cntrl: this, blurType: UI.BlurType.Acrylic, designMode: UI.Mode.DarkMode);
        }

        private void Popup_Load(object sender, EventArgs e)
        {

        }
    }
}

image

from winblur.

xVotexX avatar xVotexX commented on July 19, 2024

I've just noticed that when the Form is focused, everything is black, but when I click anywhere else, it changes its BackColor.

focusgif

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

Thing is, I noticed you have to minimize and reopen the form for it to work. Also, perhaps there's a backcolor that's tampering with the color. You might've set the backcolor of a Panel for example as Black. Anyways, if it still doesn't work, then like I said this is a temporary solution. I will be working on a better solution and I'll update the package once I have done it.

from winblur.

xVotexX avatar xVotexX commented on July 19, 2024

The problem now is that even if I remove your fix, the background is still not what it should be. Now it's not even just transparent. Minimising and reopening does not help.

using System;
using System.Drawing;
using System.Windows.Forms;
using WinBlur;
using static WinBlur.UI;

namespace WindowsFormsApp2
{
    public partial class Popup : Form
    {


        public Popup()
        {
            InitializeComponent();
            SetBlurStyle(cntrl: this, blurType: BlurType.Acrylic, designMode: Mode.DarkMode);
        }

        private void Popup_Load(object sender, EventArgs e)
        {

        }
    }
}

image

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

I just realized... Are you on Windows 10?
Dude 😭 This doesn't work on Windows 10. The Blur effects have been introduced in Windows 11 and only a very very few versions of Windows 10. Perhaps the final versions, and even then, you'd have to do some work to enable the Effects. I'm sorry, but it's your OS, not the package.

Your original issue is still valid though, and I am still gonna work on fixing it.

from winblur.

xVotexX avatar xVotexX commented on July 19, 2024

Damn. Thats sad. You should remove the "Windows 10" in your Readme then i guess.
Do you know anything similar that works on Win10?

from winblur.

voidZiAD avatar voidZiAD commented on July 19, 2024

Well. It does work on Win10, so It's not incorrect. It's just that, it doesn't work on all versions, and you have to enable it most of the time.

And unfortunately there are no blur effects supported on Versions below 10-11, unless you create it yourself via the Form using user controls and code.

from winblur.

xVotexX avatar xVotexX commented on July 19, 2024

Too bad. Good luck then

from winblur.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.