d2lmirrors / anolis

Anolis is the underlying project for the XPize and Vize resource switchers for Windows XP and Vista respectivly. The codebase allows for the easy swapping around of resources within Win32 executables and other files. (just adding some missing data)
GNU General Public License v2.0
1 stars 0 forks source link

x64 Control may not support transparent background colors #25

Closed Dobby233Liu closed 1 year ago

Dobby233Liu commented 1 year ago

creation date = 2009-03-04T12:43:12.29-08:00

IWizardForm wiz = WizardFactory.Create() causes this ArgumentException in Anolis.GUI.Program   I am not sure if this is related to compiling on Visual Studio 2008 x64. Here's a possible resolution, maybe you can find a way to insert it in the base form class for W3b.Wizards

1) in class constructor: SetStyle(ControlStyles.SupportsTransparentBackColor, true); 2) a BackColor override:

    public override Color BackColor
    {
        get
        {
            return base.BackColor;
        }
        set
        {
            if (base.BackColor != value)
            {
              base.BackColor = value;
              TransparentMode = (base.BackColor == Color.Transparent);
              this.InvalidateEx();
            }
        }
    }

3) a OnPaintBackground override:

    protected override void OnPaintBackground(PaintEventArgs pevent)
    {
        if (TransparentMode)
        {
            base.OnPaintBackground(pevent);
            return;
        }
        PaintGradientBackground(pevent.Graphics);
    }

There's also the WS_EX_TRANSPARENT style for doing something similar but I doubt it would work in this case

Dobby233Liu commented 1 year ago

creation date = 2009-03-04T15:27:39.753-08:00

I'm not quite sure I understand the problem being reported.

The W3b.Wizards library returns an AeroWizard instance on Vista or higher and a Wizard97 form on XP and earlier. Are you running on Vista? That might be the problem because I haven't really worked on the AeroWizard form. I'll modify Anolis.Gui so that it always uses Wizard97 and doesn't use the WizardFactory.

I'm developing with VS2008 on XPx64 btw.

Dobby233Liu commented 1 year ago

creation date = 2009-03-05T00:17:49.95-08:00

Yes, I'm working on Vista x64... I guess in this case there's something trying to use a transparent background color on the glass part of the form which doesn't work with the old WS_TRANSPARENT

Dobby233Liu commented 1 year ago

creation date = 2009-03-05T12:10:31.16-08:00

I've spoken to Sven (who wrote the ExtendedForm class). The problem is caused by my placement of a control with a transparent background on top of a glass region. He says I'll have to paint directly to the DC of the form (bit of a shame, but doable).

Dobby233Liu commented 1 year ago

closed date = 2009-04-17T14:39:07.227-07:00

This is now closed. I've fixed the initial problem and am working on implementing the Back button in Aero Wizard forms.