1

Closed

x64 Control may not support transparent background colors

description

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
Closed Apr 17, 2009 at 9:39 PM by W3bbo
This is now closed. I've fixed the initial problem and am working on implementing the Back button in Aero Wizard forms.

comments

W3bbo wrote Mar 4, 2009 at 10:27 PM

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.

dexterinside wrote Mar 5, 2009 at 7:17 AM

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

W3bbo wrote Mar 5, 2009 at 7:10 PM

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).

wrote Mar 5, 2009 at 9:32 PM

wrote Mar 5, 2009 at 9:34 PM

wrote Mar 5, 2009 at 9:42 PM

wrote Mar 5, 2009 at 9:43 PM

wrote Apr 17, 2009 at 9:39 PM

wrote Feb 14, 2013 at 8:13 PM

wrote May 16, 2013 at 9:36 AM