Background color with Backgroundtypesolid

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hello,

I want to change the background color into SE Classic so i used 

 m_application.SetGlobalParameter(SolidEdgeFramework.ApplicationGlobalConstants.seApplicationGlobalColorBackground, 6442534);

I noticed that the background changed in solid type but the selected type is gradient.
I tryed to change the type from gradient to solid  ,I can't get any luck.

I used this code 

viewstyles = (SolidEdgeFramework.ViewStyles)document1.ViewStyles;
                // viewstyle = viewstyles.Item(1);
                for (int i = 0; i < viewstyles.Count; i++)
                {
                    viewstyles.Item(i).BackgroundType = SolidEdgeFramework.SeBackgroundType.seBackgroundTypeSolid;
                }

 

Any help??

 

1 REPLY

Re: Background color with Backgroundtypesolid

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

The following code sets the background to either Gradient or Solid. Note, that there is a special ImageFile description for the gradient background:

    '----------------------------------------------------------------------
    ' PAR/ASM: Set the view background to either gradient or solid style
    '----------------------------------------------------------------------
    Const TopColor As Int32 = &H3F3F3F ' DarkGray (RGB)
    Const BottomColor As Int32 = &HFFFFFF ' White (RGB)
    Const SolidColor As Int32 = &HFFFFFF ' White (RGB)

    Dim bGradient As Boolean = False
    Dim objDoc As SolidEdgeDocument = objApp.ActiveDocument
    If objDoc.Type = DocumentTypeConstants.igDraftDocument Then Exit Sub

    Dim objWin As Window = objDoc.Windows.Item(1)
    Dim objStyle As ViewStyle = objWin.View.ViewStyle
    If bGradient Then
      ' Change to GRADIENT background
      objStyle.BackgroundType = SeBackgroundType.seBackgroundTypeGradient
      objStyle.BackgroundImageFile = String.Format("$$grad_s_{0:x6}_{1:x6}$$", TopColor, BottomColor)
    Else
      ' Change to SOLID background (simulate it using gradient with same top & bottom color)
      objStyle.BackgroundType = SeBackgroundType.seBackgroundTypeGradient
      objStyle.BackgroundImageFile = String.Format("$$grad_s_{0:x6}_{1:x6}$$", SolidColor, SolidColor)
    End If
    objWin.View.Update()