Version

IncrementValue Method

Increments the value of the control by the specified amount.
Syntax
'Declaration
 
Public Sub IncrementValue( _
   ByVal amount As Integer _
) 
public void IncrementValue( 
   int amount
)

Parameters

amount
Amount to change the value.
Remarks

The IncrementStep is analogous to adding a particular amount to the Value property. However, the Value property must be set to a value within the Minimum and Maximum values or an exception will be generated. The IncrementValue method takes the Minimum and Maximum values into account as it adjusts the Value and therefore may be more convenient to use.

Example

The following sample code illustrates how to call the PerformStep and IncrementValuemethod.



Imports Infragistics.Win

   Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click

       ' Call the 'PerformStep' method which will
       ' increment the 'Value' property by the
       ' value of the 'Step' property.

       Me.ultraProgressBar1.PerformStep()

       ' Alternatively you can increment the value
       ' by any amount by calling the 'IncrementValue'
       ' method.

       Me.ultraProgressBar1.IncrementValue(7)

       ' Note: The advantage these methods offer over
       ' just adding the amount to the 'Value' property
       ' is that they will keep the value in range
       ' (between the 'Minimum' and 'Maximum' values)
       ' without throwing an exception. If you try
       ' to set the 'Value' property out of range an
       ' exception will be thrown.

   End Sub
using Infragistics.Win;

	private void button1_Click(object sender, System.EventArgs e)
	{

		// Call the 'PerformStep' method which will
		// increment the 'Value' property by the
		// value of the 'Step' property.
		
		this.ultraProgressBar1.PerformStep();

		// Alternatively you can increment the value
		// by any amount by calling the 'IncrementValue'
		// method.
		
		this.ultraProgressBar1.IncrementValue( 7 );

		// Note: The advantage these methods offer over
		// just adding the amount to the 'Value' property
		// is that they will keep the value in range
		// (between the 'Minimum' and 'Maximum' values)
		// without throwing an exception. If you try
		// to set the 'Value' property out of range an
		// exception will be thrown.

	}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also