property XMLGrid.Background(Part as BackgroundPartEnum) as Color
Returns or sets a value that indicates the background color for parts in the control.

 TypeDescription 
   Part as BackgroundPartEnum A BackgroundPartEnum expression that indicates a part in the control.  
   Color A Color expression that indicates the background color for a specified part. The last 7 bits in the high significant byte of the color to indicates the identifier of the skin being used. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the background's part.  

The Background property specifies a background color or a visual appearance for specific parts in the control. If the Background property is 0, the control draws the part as default. Use the Add method to add new skins to the control. Use the Remove method to remove a specific skin from the control. Use the Clear method to remove all skins in the control. Use the BeginUpdate and EndUpdate methods to maintain performance while init the control. Use the Refresh method to refresh the control.

The following VB sample changes the visual appearance for the expand buttons. The sample uses the "" for up state, and ""

With XMLGrid1
    With .VisualAppearance
        .Add &H12, App.Path + "\expandu.ebn"
        .Add &H13, App.Path + "\expandd.ebn"
    End With
    .Background(exExpandButtonUp) = &H12000000
    .Background(exExpandButtonDown) = &H13000000
End With

The following C++ sample changes the visual appearance for the expand buttons:

#include "Appearance.h"
m_xmlgrid.GetVisualAppearance().Add( 0x12, COleVariant(_T("D:\\Temp\\EXMLGrid.Help\\expandu.ebn")) );
m_xmlgrid.GetVisualAppearance().Add( 0x13, COleVariant(_T("D:\\Temp\\EXMLGrid.Help\\expandd.ebn")) );
m_xmlgrid.SetBackground( 0, 0x12000000 );
m_xmlgrid.SetBackground( 1, 0x13000000 );

The following VB.NET sample changes the visual appearance for the expand buttons:

With AxXMLGrid1
    With .VisualAppearance
        .Add(&H12, "d:\temp\EXMLGrid.Help\expandu.ebn")
        .Add(&H13, "d:\temp\EXMLGrid.Help\expandd.ebn")
    End With
    .set_Background(EXMLGRIDLib.BackgroundPartEnum.exExpandButtonUp, &H12000000)
    .set_Background(EXMLGRIDLib.BackgroundPartEnum.exExpandButtonDown, &H13000000)
End With

The following C# sample changes the visual appearance for the expand buttons:

axXMLGrid1.VisualAppearance.Add(0x12, "d:\\temp\\EXMLGrid.Help\\expandu.ebn");
axXMLGrid1.VisualAppearance.Add(0x13, "d:\\temp\\EXMLGrid.Help\\expandd.ebn");
axXMLGrid1.set_Background(EXMLGRIDLib.BackgroundPartEnum.exExpandButtonUp, 0x12000000);
axXMLGrid1.set_Background(EXMLGRIDLib.BackgroundPartEnum.exExpandButtonDown, 0x13000000);

The following VFP sample changes the visual appearance for the expand buttons:

With thisform.XMLGrid1
    With .VisualAppearance
        .Add(18, "D:\Temp\EXMLGrid.Help\expandu.ebn")
        .Add(19, "D:\Temp\EXMLGrid.Help\expandd.ebn")
    EndWith
    .Background(0) = 301989888
    .Background(1) = 318767104
EndWith

where the 301989888 value is the hexa representation for 0x12000000, and 318767104 is 0x13000000.


Send comments on this topic.
1999-2015 Exontrol.COM, Software. All rights reserved.