Loading...
Loading...
Guide for implementing Syncfusion Office2007Form in Windows Forms applications for creating Microsoft Office-styled forms. Use this skill when implementing Office 2007 UI styling, applying Office color schemes, or customizing form appearance in Windows Forms. Covers installation, theming, caption customization, and AeroTheme configuration.
npx skill4agent add syncfusion/winforms-ui-components-skills syncfusion-winforms-office2007formOffice2007FormSystem.Windows.Forms.FormInstall-Package Syncfusion.Shared.BaseSyncfusion.Shared.Base.dllusing Syncfusion.Windows.Forms;Syncfusion.Shared.BaseSyncfusion.Shared.Base.dllusing Syncfusion.Windows.Forms;using System;
using System.Drawing;
using System.Windows.Forms;
using Syncfusion.Windows.Forms; // Required: Syncfusion.Shared.Base package
namespace MyApplication
{
// Inherit from Office2007Form instead of Form
public partial class MainForm : Office2007Form
{
public MainForm()
{
InitializeComponent();
// Set basic properties
this.Text = "My Office 2007 Application";
this.Size = new Size(800, 600);
// Apply Blue color scheme
this.ColorScheme = Office2007Theme.Blue;
// Optional: Use scheme background color
this.UseOffice2007SchemeBackColor = true;
}
}
}public partial class CustomForm : Office2007Form
{
public CustomForm()
{
InitializeComponent();
this.Text = "Customized Office Form";
// Apply color scheme
this.ColorScheme = Office2007Theme.Silver;
// Customize caption
this.CaptionAlign = HorizontalAlignment.Center;
this.CaptionFont = new Font("Segoe UI", 12F, FontStyle.Bold);
this.CaptionForeColor = Color.DarkBlue;
this.CaptionBarHeight = 40;
}
}public partial class ManagedColorForm : Office2007Form
{
public CustomForm()
{
InitializeComponent();
this.Text = "Custom Color Theme";
// Apply managed scheme with custom color
this.ColorScheme = Office2007Theme.Managed;
Office2007Colors.ApplyManagedColors(this, Color.DarkMagenta);
this.UseOffice2007SchemeBackColor = true;
}
}public class MyForm : Office2007Form
{
public MyForm()
{
InitializeComponent();
this.Text = "My Application";
this.ColorScheme = Office2007Theme.Blue; // or Silver, Black
this.UseOffice2007SchemeBackColor = true;
}
}public class BrandedForm : Office2007Form
{
public BrandedForm()
{
InitializeComponent();
// Apply theme
this.ColorScheme = Office2007Theme.Black;
// Brand the caption
this.CaptionAlign = HorizontalAlignment.Center;
this.CaptionFont = new Font("Arial", 14F, FontStyle.Bold);
this.CaptionForeColor = Color.Gold;
this.CaptionBarHeight = 45;
this.CaptionBarHeightMode =
Syncfusion.Windows.Forms.Enums.CaptionBarHeightMode.SameAlwaysOnMaximize;
}
}public class CustomBrandForm : Office2007Form
{
public CustomBrandForm()
{
InitializeComponent();
this.Text = "Brand Color Application";
// Use company brand color
this.ColorScheme = Office2007Theme.Managed;
Color brandColor = Color.FromArgb(0, 120, 215); // Custom blue
Office2007Colors.ApplyManagedColors(this, brandColor);
this.UseOffice2007SchemeBackColor = true;
}
}public class NoAeroForm : Office2007Form
{
public NoAeroForm()
{
InitializeComponent();
// Disable Aero to allow color scheme
this.ApplyAeroTheme = false;
// Now apply your color scheme
this.ColorScheme = Office2007Theme.Silver;
}
}public class ModernForm : Office2007Form
{
public ModernForm()
{
InitializeComponent();
this.Text = "Modern Application";
this.ColorScheme = Office2007Theme.Blue;
// Enable rounded corners (Windows 11 only)
this.AllowRoundedCorners = true;
}
}public class RtlForm : Office2007Form
{
public RtlForm()
{
InitializeComponent();
this.Text = "تطبيق"; // Arabic text
this.ColorScheme = Office2007Theme.Blue;
// Enable RTL
this.RightToLeft = RightToLeft.Yes;
this.RightToLeftLayout = true;
}
}| Property | Type | Description |
|---|---|---|
| | Sets color scheme: Blue, Silver, Black, Managed |
| | Caption text alignment (Left, Center, Right) |
| | Caption bar font style |
| | Caption text color |
| | Height of caption bar in pixels |
| | Height behavior in maximized state |
| | Match form background to color scheme |
| | Enable/disable Aero glass effect |
| | Rounded corners (Windows 11 only) |
| | RTL text direction |
| | RTL layout mirroring |
| | Revert to standard form appearance |
| | Show help button in caption bar |
public partial class MyForm : Form
{
public MyForm()
{
InitializeComponent();
this.Text = "My Application";
}
}public partial class MyForm : Office2007Form
{
public MyForm()
{
InitializeComponent();
this.Text = "My Application";
this.ColorScheme = Office2007Theme.Blue;
this.UseOffice2007SchemeBackColor = true;
}
}FormOffice2007Formusing Syncfusion.Windows.Forms;Syncfusion.Shared.Base.dllColorSchemeApplyAeroThemefalseCaptionBarHeightMode = SameAlwaysOnMaximizeSyncfusion.Shared.Base.dll