---
title: "ListItem..::.OnStateChanging Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_WinControls_ListItem_OnStateChanging_1_2d9e7391.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# ListItem.OnStateChanging Method 
 
Raises the [StateChanging](https://www.graphicsmill.com/docs/gm5/E_Aurigma_GraphicsMill_WinControls_ListItem_StateChanging.htm.md) event.
 
**Namespace:** [Aurigma.GraphicsMill.WinControls](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
 **Assembly:** Aurigma.GraphicsMill.WinControls (in Aurigma.GraphicsMill.WinControls.dll)
 
## Syntax
  
```
Protected Overridable Function OnStateChanging ( _stateType As StateType _
) As Boolean
```
 
```csharp
protected virtual bool OnStateChanging(StateType stateType
)
```
 
### Parameters
 
 - stateType
     - Type: [Aurigma.GraphicsMill.WinControls.StateType](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_StateType.htm.md)
A [StateType](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_StateType.htm.md) value specifying the state the event is raised for.
 
### Return Value
A value from the [StateChanging](https://www.graphicsmill.com/docs/gm5/E_Aurigma_GraphicsMill_WinControls_ListItem_StateChanging.htm.md) event specifying whether to cancel the state change.
   
## See Also

### Reference

- [ListItem Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_WinControls_ListItem.htm.md)
- [Aurigma.GraphicsMill.WinControls Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_WinControls.htm.md)
