Loading...
Loading...
Compare original and translation side by side
using Syncfusion.Windows.Forms.Tools;
using Syncfusion.Drawing;
// Create GradientPanelExt
GradientPanelExt gradientPanel = new GradientPanelExt();
gradientPanel.Size = new Size(400, 200);
gradientPanel.Location = new Point(20, 20);
// Set gradient background (horizontal blue gradient)
gradientPanel.BackgroundColor = new BrushInfo(
GradientStyle.Horizontal,
Color.DarkBlue,
Color.LightSkyBlue
);
// Rounded corners
gradientPanel.CornerRadius = 10;
// Add child controls
Label label = new Label
{
Text = "Welcome",
ForeColor = Color.White,
BackColor = Color.Transparent,
Location = new Point(20, 20),
AutoSize = true
};
gradientPanel.Controls.Add(label);
// Add to form
this.Controls.Add(gradientPanel);using Syncfusion.Windows.Forms.Tools;
using Syncfusion.Drawing;
// Create GradientPanelExt
GradientPanelExt gradientPanel = new GradientPanelExt();
gradientPanel.Size = new Size(400, 200);
gradientPanel.Location = new Point(20, 20);
// Set gradient background (horizontal blue gradient)
gradientPanel.BackgroundColor = new BrushInfo(
GradientStyle.Horizontal,
Color.DarkBlue,
Color.LightSkyBlue
);
// Rounded corners
gradientPanel.CornerRadius = 10;
// Add child controls
Label label = new Label
{
Text = "Welcome",
ForeColor = Color.White,
BackColor = Color.Transparent,
Location = new Point(20, 20),
AutoSize = true
};
gradientPanel.Controls.Add(label);
// Add to form
this.Controls.Add(gradientPanel);// Add title text primitive at top border
TextPrimitive titlePrimitive = new TextPrimitive
{
Text = "User Login",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
TextColor = Color.White,
TextFont = new Font("Arial", 12, FontStyle.Bold),
Size = new Size(100, 25),
BackColor = Color.Transparent
};
// Add button primitives at bottom border
TextPrimitive okButton = new TextPrimitive
{
Text = "OK",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Bottom,
Position = 100,
Size = new Size(60, 25),
BackColor = Color.White,
TextColor = Color.Black
};
TextPrimitive cancelButton = new TextPrimitive
{
Text = "Cancel",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Bottom,
Position = 180,
Size = new Size(60, 25),
BackColor = Color.White,
TextColor = Color.Black
};
// Add primitives to panel
gradientPanel.Primitives.AddRange(new Primitive[] {
titlePrimitive,
okButton,
cancelButton
});// Add title text primitive at top border
TextPrimitive titlePrimitive = new TextPrimitive
{
Text = "User Login",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
TextColor = Color.White,
TextFont = new Font("Arial", 12, FontStyle.Bold),
Size = new Size(100, 25),
BackColor = Color.Transparent
};
// Add button primitives at bottom border
TextPrimitive okButton = new TextPrimitive
{
Text = "OK",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Bottom,
Position = 100,
Size = new Size(60, 25),
BackColor = Color.White,
TextColor = Color.Black
};
TextPrimitive cancelButton = new TextPrimitive
{
Text = "Cancel",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Bottom,
Position = 180,
Size = new Size(60, 25),
BackColor = Color.White,
TextColor = Color.Black
};
// Add primitives to panel
gradientPanel.Primitives.AddRange(new Primitive[] {
titlePrimitive,
okButton,
cancelButton
});// Create login panel
GradientPanelExt loginPanel = new GradientPanelExt
{
Size = new Size(350, 180),
Location = new Point(50, 50),
CornerRadius = 12
};
// Dark gradient background
loginPanel.BackgroundColor = new BrushInfo(
GradientStyle.Horizontal,
Color.FromArgb(40, 40, 40),
Color.FromArgb(80, 80, 80)
);
// Title primitive at top
TextPrimitive title = new TextPrimitive
{
Text = "Login",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
TextColor = Color.White,
TextFont = new Font("Segoe UI", 14, FontStyle.Bold),
Size = new Size(80, 30),
BackColor = Color.Transparent
};
loginPanel.Primitives.Add(title);
// Add username and password textboxes inside panel
Label lblUsername = new Label
{
Text = "Username:",
Location = new Point(30, 40),
ForeColor = Color.White,
BackColor = Color.Transparent,
AutoSize = true
};
TextBox txtUsername = new TextBox
{
Location = new Point(110, 38),
Size = new Size(180, 20)
};
loginPanel.Controls.Add(lblUsername);
loginPanel.Controls.Add(txtUsername);// Create login panel
GradientPanelExt loginPanel = new GradientPanelExt
{
Size = new Size(350, 180),
Location = new Point(50, 50),
CornerRadius = 12
};
// Dark gradient background
loginPanel.BackgroundColor = new BrushInfo(
GradientStyle.Horizontal,
Color.FromArgb(40, 40, 40),
Color.FromArgb(80, 80, 80)
);
// Title primitive at top
TextPrimitive title = new TextPrimitive
{
Text = "Login",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
TextColor = Color.White,
TextFont = new Font("Segoe UI", 14, FontStyle.Bold),
Size = new Size(80, 30),
BackColor = Color.Transparent
};
loginPanel.Primitives.Add(title);
// Add username and password textboxes inside panel
Label lblUsername = new Label
{
Text = "Username:",
Location = new Point(30, 40),
ForeColor = Color.White,
BackColor = Color.Transparent,
AutoSize = true
};
TextBox txtUsername = new TextBox
{
Location = new Point(110, 38),
Size = new Size(180, 20)
};
loginPanel.Controls.Add(lblUsername);
loginPanel.Controls.Add(txtUsername);// Create collapsible panel
GradientPanelExt dashboardPanel = new GradientPanelExt
{
Size = new Size(400, 250),
Location = new Point(20, 20),
CornerRadius = 8,
Animated = true,
AnimationSpeed = 3
};
// Vertical gradient
dashboardPanel.BackgroundColor = new BrushInfo(
GradientStyle.Vertical,
Color.WhiteSmoke,
Color.LightGray
);
// Section title
TextPrimitive sectionTitle = new TextPrimitive
{
Text = "Sales Statistics",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
TextColor = Color.DarkBlue,
TextFont = new Font("Arial", 12, FontStyle.Bold),
Size = new Size(150, 25)
};
// Collapse primitive
CollapsePrimitive collapseButton = new CollapsePrimitive
{
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
Position = 350,
Size = new Size(30, 30),
BackColor = Color.Transparent
};
// Set images in designer or load from resources
dashboardPanel.Primitives.AddRange(new Primitive[] {
sectionTitle,
collapseButton
});// Create collapsible panel
GradientPanelExt dashboardPanel = new GradientPanelExt
{
Size = new Size(400, 250),
Location = new Point(20, 20),
CornerRadius = 8,
Animated = true,
AnimationSpeed = 3
};
// Vertical gradient
dashboardPanel.BackgroundColor = new BrushInfo(
GradientStyle.Vertical,
Color.WhiteSmoke,
Color.LightGray
);
// Section title
TextPrimitive sectionTitle = new TextPrimitive
{
Text = "Sales Statistics",
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
TextColor = Color.DarkBlue,
TextFont = new Font("Arial", 12, FontStyle.Bold),
Size = new Size(150, 25)
};
// Collapse primitive
CollapsePrimitive collapseButton = new CollapsePrimitive
{
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
Position = 350,
Size = new Size(30, 30),
BackColor = Color.Transparent
};
// Set images in designer or load from resources
dashboardPanel.Primitives.AddRange(new Primitive[] {
sectionTitle,
collapseButton
});// Create styled panel
GradientPanelExt styledPanel = new GradientPanelExt
{
Size = new Size(450, 300),
CornerRadius = 10
};
// PathEllipse gradient with multiple colors
styledPanel.BackgroundColor = new BrushInfo(
GradientStyle.PathEllipse,
new Color[]
{
Color.LightBlue,
Color.LightCyan,
Color.PaleTurquoise
}
);
// Image primitive at top-left
ImagePrimitive logo = new ImagePrimitive
{
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
Position = 10,
Size = new Size(40, 40)
// Set Image property from resources
};
// Host a ProgressBar at bottom
ProgressBar progressBar = new ProgressBar
{
Value = 50,
Style = ProgressBarStyle.Continuous
};
HostPrimitive progressHost = new HostPrimitive
{
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Bottom,
Position = 100,
Size = new Size(250, 20),
HostControl = progressBar,
BackColor = Color.Transparent
};
styledPanel.Primitives.AddRange(new Primitive[] {
logo,
progressHost
});// Create styled panel
GradientPanelExt styledPanel = new GradientPanelExt
{
Size = new Size(450, 300),
CornerRadius = 10
};
// PathEllipse gradient with multiple colors
styledPanel.BackgroundColor = new BrushInfo(
GradientStyle.PathEllipse,
new Color[]
{
Color.LightBlue,
Color.LightCyan,
Color.PaleTurquoise
}
);
// Image primitive at top-left
ImagePrimitive logo = new ImagePrimitive
{
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Top,
Position = 10,
Size = new Size(40, 40)
// Set Image property from resources
};
// Host a ProgressBar at bottom
ProgressBar progressBar = new ProgressBar
{
Value = 50,
Style = ProgressBarStyle.Continuous
};
HostPrimitive progressHost = new HostPrimitive
{
Alignment = Syncfusion.Windows.Forms.Tools.Alignment.Bottom,
Position = 100,
Size = new Size(250, 20),
HostControl = progressBar,
BackColor = Color.Transparent
};
styledPanel.Primitives.AddRange(new Primitive[] {
logo,
progressHost
});