BunifuColorTransition is a Component that makes possible the transition (in small increments) from one color to another. It's useful when you want to show different states / progression of an activity.
How to use BunifuColorTransition at Design Time
Simply locate BunifuColorTransition control in your toolbox and drag it on to your form. You can then customize using custom properties as it will be elaborated later in this article
When you click on the component and go to the Properties Tab, we’ll see the following properties:
- StartColor - is the start color (the initial color) and EndColor is the target color (the color that stops the transition)
- ProgressValue - is a value between 0 and 100 that sets the gradient between the StartColor and EndColor
- Value - is the current value of the transition (the intermediate color between StartColor and EndColor, specified by the Progress Value property)
- AutoTransition - is a boolean that allows you to set automatic transition of specific TransitionControl.
- ColorArray - is array of colors to transition from and to.
- Interval - is the speed of transition between the color arrays.
We want to change the background color of our form (BackColor) in a gradient from White to Red according to the value pointed by a Bunifu TrackBar.
So let’s add that trackbar to our form and after we place it on our form, let’s go to “Properties” tab and then on “Events” and then scroll down until we find the Value Changed Event:
Using the event handler we will add the code below:
private void bunifuTrackbar1_ValueChanged(object sender, EventArgs e)
bunifuColorTransition1.ProgessValue = bunifuTrackbar1.Value;
this.BackColor = bunifuColorTransition1.Value;
Private Sub BunifuTrackbar1_ValueChanged(sender As Object, e As EventArgs) Handles BunifuTrackbar1.ValueChanged
BunifuColorTransition1.ProgessValue = BunifuTrackbar1.Value
BackColor = BunifuColorTransition1.Value
The code above sets the progress value of our Bunifu Color Component, to the trackbar value. After that we set the back color of our form to the Value pointed by our component.
If you wish to create a splash screen using BunifuColorTransition set the following properties
We hope BunifuColorTransition will help improve user experience in your design.
Should you have feedback or suggestions please send us via chat on the bottom right corner of the screen.