$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Menus Control for Windows Forms
Design menus with animation effects, flexible orientation, custom backgrounds, and image menus
Home > WinForms UI Controls > User Manual > Animation Menus in C#

Create Animation Menus in C#.NET

Kettic Menu Control for Windows Forms is capable of creating animation effects menus for C#.NET applications. It is able to expand and collapse the drop down menus with animation effects. To create such an animation menus in C#.NET, we shall enable the animation functionality using DropDownAnimationEnabled property, and build the animation effects using the DropDownAnimationEasing property and DropDownAnimationFrames property.

Properties for Animating Menus in C#.NET

To design animation effects for menus using the Kettic Menu control, we should use the following properties, which are able to create expand and collapse effects for drop-down menus. The details of the properties are as below.
  • DropDownAnimationEnabled, this property is used to create animation effects for menus expanding and collapsing. It is enabled by change the value to True.
  • DropDownAnimationEasing, this property is used to set the precise animation effect on menus. The predefined valid animation effects contain linear, exponential, elastic, and more.
  • DropDownAnimationFrames, this property is used to set animation length.

Create Menus Animated in C#.NET

In the following sample, we are going to create menu in C#.NET by using the Kettic Menu controls and then we can toggle animation on and off, change the type of animation and alter the animation speed. We shall apply various controls in the process, including KetticMenu, KetticCheckBox, KetticLabel, KetticTrackBar, and KetticDropDownList.
The following is the C# code used to load the KetticDropDownList with members of the KetticEasingType enumeration. The C# code shall iterate the enumeration, and add the string representation and the enumerated value.

foreach (KetticEasingType ret in Enum.GetValues(typeof(KetticEasingType)))
{
KetticListDataItem item = new KetticListDataItem();
item.Text = ret.ToString("f");
item.Value = ret;
ddlAnimation.Items.Add(item);
}
ddlAnimation.SelectedIndex = 0;
When we are going to process the animation, we shall use the event handlers like, KetticDropDownListChangedIndexSelected, KetticChangedCheckBoxToggleState, and KetticChangedTrackBar Value. The following explains the process of the animating.
  1. First, the enumeration value will set to the property, KetticMenuDropDownAnimationEasing, when choosing the KetticDropDownList to change the KetticEasingType.
  2. Second, the KetticCheckBoxClick event handler will toggle the DropDownAnimationEnabled property.
  3. Finally, the KetticTrackBarValueChanged event handler will set the DropDownAnimationFrames property and show the current value in the label.

void ddlAnimation_ChangedIndexSelected(object sender, Kettic.WinForms.UI.Data.PositionChangedEventArgs e)
{
KetticListDataItem item = (sender as KetticDropDownListElement).SelectedItem as KetticListDataItem;
KetticMenu1.DropDownAnimationEasing = (KetticEasingType)item.Value;
}

void cbEnabled_ChangedToggleState(object sender, ChangedStateEventArgs args)
{
KetticMenu1.DropDownAnimationEnabled = (sender as KetticCheckBox).IsChecked;
}

void tbFrames_ValueChanged(object sender, EventArgs e)
{
object trackBarValue = (sender as KetticTrackBar).Value;
lblFrames.Text = "Frames: " + trackBarValue.ToString();
KetticMenu1.DropDownAnimationFrames = (int)trackBarValue;
}

UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls